|
1 | | -using System; |
| 1 | +using Amino.Interactions.Objects; |
| 2 | +using System; |
2 | 3 | using System.Collections.Generic; |
3 | 4 | using System.Linq; |
4 | 5 | using System.Text; |
5 | 6 | using System.Threading.Tasks; |
6 | | - |
| 7 | +using Amino; |
| 8 | +using System.Security.Cryptography.X509Certificates; |
7 | 9 | namespace Amino.Interactions |
8 | 10 | { |
9 | 11 | public class InteractionBase |
10 | 12 | { |
11 | | - public Objects.Interaction Context; |
12 | 13 |
|
13 | 14 |
|
| 15 | + public Task<Amino.Objects.Message> Respond(Interaction context, string message, bool asReply = true) |
| 16 | + { |
| 17 | + SubClient subClient = new SubClient(context.AminoClient, context.Message.communityId.ToString()); |
| 18 | + var ReturnMessage = subClient.send_message(message, context.InteractionChatId, replyTo: asReply ? context.Message.messageId : null); |
| 19 | + return Task.FromResult(ReturnMessage); |
| 20 | + } |
| 21 | + |
| 22 | + public Task RespondWithFile(Interaction context, byte[] file, Amino.Types.upload_File_Types type = Types.upload_File_Types.Image) |
| 23 | + { |
| 24 | + SubClient subClient = new SubClient(context.AminoClient, context.Message.communityId.ToString()); |
| 25 | + subClient.send_file_message(context.InteractionChatId, file, type); |
| 26 | + return Task.CompletedTask; |
| 27 | + } |
| 28 | + |
| 29 | + public Task RespondWithSticker(Interaction context, string stickerId) |
| 30 | + { |
| 31 | + SubClient subClient = new SubClient(context.AminoClient, context.Message.communityId.ToString()); |
| 32 | + subClient.send_sticker(context.InteractionChatId, stickerId); |
| 33 | + return Task.CompletedTask; |
| 34 | + } |
| 35 | + |
| 36 | + public Task RespondWithEmbed(Interaction context, string content, string embedId = null, string embedLink = null, string embedTitle = null, string embedContent = null, byte[] embedImage = null) |
| 37 | + { |
| 38 | + SubClient subClient = new SubClient(context.AminoClient, context.Message.communityId.ToString()); |
| 39 | + subClient.send_embed(context.InteractionChatId, content, embedId, embedLink, embedTitle, embedContent, embedImage); |
| 40 | + return Task.CompletedTask; |
| 41 | + } |
| 42 | + |
14 | 43 | } |
15 | 44 | } |
0 commit comments