|
| 1 | +using Discord.Rest; |
1 | 2 | using System;
|
| 3 | +using System.Collections.Generic; |
| 4 | +using System.IO; |
2 | 5 | using System.Threading.Tasks;
|
3 | 6 |
|
4 | 7 | namespace Discord.Interactions
|
@@ -47,18 +50,66 @@ protected virtual async Task RespondAsync (string text = null, Embed[] embeds =
|
47 | 50 | AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent components = null, Embed embed = null) =>
|
48 | 51 | await Context.Interaction.RespondAsync(text, embeds, isTTS, ephemeral, allowedMentions, components, embed, options).ConfigureAwait(false);
|
49 | 52 |
|
| 53 | + /// <inheritdoc cref="IDiscordInteraction.RespondWithFileAsync(Stream, string, string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions)"/> |
| 54 | + protected virtual Task RespondWithFileAsync(Stream fileStream, string fileName, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, |
| 55 | + AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null) |
| 56 | + => Context.Interaction.RespondWithFileAsync(fileStream, fileName, text, embeds, isTTS, ephemeral, allowedMentions, components, embed, options); |
| 57 | + |
| 58 | + /// <inheritdoc cref="IDiscordInteraction.RespondWithFileAsync(string, string, string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions)"/> |
| 59 | + protected virtual Task RespondWithFileAsync(string filePath, string fileName = null, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, |
| 60 | + AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null) |
| 61 | + => Context.Interaction.RespondWithFileAsync(filePath, fileName, text, embeds, isTTS, ephemeral, allowedMentions, components, embed, options); |
| 62 | + |
| 63 | + /// <inheritdoc cref="IDiscordInteraction.RespondWithFileAsync(FileAttachment, string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions)"/> |
| 64 | + protected virtual Task RespondWithFileAsync(FileAttachment attachment, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, |
| 65 | + AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null) |
| 66 | + => Context.Interaction.RespondWithFileAsync(attachment, text, embeds, isTTS, ephemeral, allowedMentions, components, embed, options); |
| 67 | + |
| 68 | + /// <inheritdoc cref="IDiscordInteraction.RespondWithFilesAsync(IEnumerable{FileAttachment}, string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions)"/> |
| 69 | + protected virtual Task RespondWithFilesAsync(IEnumerable<FileAttachment> attachments, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, |
| 70 | + AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null) |
| 71 | + => Context.Interaction.RespondWithFilesAsync(attachments, text, embeds, isTTS, ephemeral, allowedMentions, components, embed, options); |
| 72 | + |
50 | 73 | /// <inheritdoc cref="IDiscordInteraction.FollowupAsync(string, Embed[], bool, bool, AllowedMentions, RequestOptions, MessageComponent, Embed)"/>
|
51 | 74 | protected virtual async Task<IUserMessage> FollowupAsync (string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false,
|
52 | 75 | AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent components = null, Embed embed = null) =>
|
53 | 76 | await Context.Interaction.FollowupAsync(text, embeds, isTTS, ephemeral, allowedMentions, components, embed, options).ConfigureAwait(false);
|
54 | 77 |
|
| 78 | + /// <inheritdoc cref="IDiscordInteraction.FollowupWithFileAsync(Stream, string, string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions)"/> |
| 79 | + protected virtual Task<IUserMessage> FollowupWithFileAsync(Stream fileStream, string fileName, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, |
| 80 | + AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null) |
| 81 | + => Context.Interaction.FollowupWithFileAsync(fileStream, fileName, text, embeds, isTTS, ephemeral, allowedMentions, components, embed, options); |
| 82 | + |
| 83 | + /// <inheritdoc cref="IDiscordInteraction.FollowupWithFileAsync(string, string, string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions)"/> |
| 84 | + protected virtual Task<IUserMessage> FollowupWithFileAsync(string filePath, string fileName = null, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, |
| 85 | + AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null) |
| 86 | + => Context.Interaction.FollowupWithFileAsync(filePath, fileName, text, embeds, isTTS, ephemeral, allowedMentions, components, embed, options); |
| 87 | + |
| 88 | + /// <inheritdoc cref="IDiscordInteraction.FollowupWithFileAsync(FileAttachment, string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions)"/> |
| 89 | + protected virtual Task<IUserMessage> FollowupWithFileAsync(FileAttachment attachment, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, |
| 90 | + AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null) |
| 91 | + => Context.Interaction.FollowupWithFileAsync(attachment, text, embeds, isTTS, ephemeral, allowedMentions, components, embed, options); |
| 92 | + |
| 93 | + /// <inheritdoc cref="IDiscordInteraction.FollowupWithFilesAsync(IEnumerable{FileAttachment}, string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions)"/> |
| 94 | + protected virtual Task<IUserMessage> FollowupWithFilesAsync(IEnumerable<FileAttachment> attachments, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, |
| 95 | + AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null) |
| 96 | + => Context.Interaction.FollowupWithFilesAsync(attachments, text, embeds, isTTS, ephemeral, allowedMentions, components, embed, options); |
| 97 | + |
55 | 98 | /// <inheritdoc cref="IMessageChannel.SendMessageAsync(string, bool, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])"/>
|
56 | 99 | protected virtual async Task<IUserMessage> ReplyAsync (string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null,
|
57 | 100 | AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent components = null) =>
|
58 | 101 | await Context.Channel.SendMessageAsync(text, false, embed, options, allowedMentions, messageReference, components).ConfigureAwait(false);
|
59 | 102 |
|
| 103 | + /// <inheritdoc cref="IDiscordInteraction.GetOriginalResponseAsync(RequestOptions)"/> |
| 104 | + protected virtual Task<IUserMessage> GetOriginalResponseAsync(RequestOptions options = null) |
| 105 | + => Context.Interaction.GetOriginalResponseAsync(options); |
| 106 | + |
| 107 | + /// <inheritdoc cref="IDiscordInteraction.ModifyOriginalResponseAsync(Action{MessageProperties}, RequestOptions)"/> |
| 108 | + protected virtual Task<IUserMessage> ModifyOriginalResponseAsync(Action<MessageProperties> func, RequestOptions options = null) |
| 109 | + => Context.Interaction.ModifyOriginalResponseAsync(func, options); |
| 110 | + |
60 | 111 | /// <inheritdoc cref="IDeletable.DeleteAsync(RequestOptions)"/>
|
61 |
| - protected virtual async Task DeleteOriginalResponseAsync ( ) |
| 112 | + protected virtual async Task DeleteOriginalResponseAsync() |
62 | 113 | {
|
63 | 114 | var response = await Context.Interaction.GetOriginalResponseAsync().ConfigureAwait(false);
|
64 | 115 | await response.DeleteAsync().ConfigureAwait(false);
|
|
0 commit comments