|
|
@@ -104,8 +104,12 @@ namespace Discord.Rest |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
/// <exception cref="ArgumentOutOfRangeException">Message content is too long, length must be less or equal to <see cref="DiscordConfig.MaxMessageSize"/>.</exception> |
|
|
|
public Task<RestUserMessage> SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null) |
|
|
|
=> ChannelHelper.SendMessageAsync(this, Discord, text, isTTS, embed, allowedMentions, messageReference, components, stickers, options, embeds); |
|
|
|
/// <exception cref="ArgumentException">The only valid <see cref="MessageFlags"/> are <see cref="MessageFlags.SuppressEmbeds"/> and <see cref="MessageFlags.None"/>.</exception> |
|
|
|
public Task<RestUserMessage> SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, |
|
|
|
RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, |
|
|
|
MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = MessageFlags.None) |
|
|
|
=> ChannelHelper.SendMessageAsync(this, Discord, text, isTTS, embed, allowedMentions, messageReference, |
|
|
|
components, stickers, options, embeds, flags); |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
/// <exception cref="ArgumentException"> |
|
|
@@ -132,20 +136,40 @@ namespace Discord.Rest |
|
|
|
/// <exception cref="NotSupportedException"><paramref name="filePath" /> is in an invalid format.</exception> |
|
|
|
/// <exception cref="IOException">An I/O error occurred while opening the file.</exception> |
|
|
|
/// <exception cref="ArgumentOutOfRangeException">Message content is too long, length must be less or equal to <see cref="DiscordConfig.MaxMessageSize"/>.</exception> |
|
|
|
public Task<RestUserMessage> SendFileAsync(string filePath, string text, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null) |
|
|
|
=> ChannelHelper.SendFileAsync(this, Discord, filePath, text, isTTS, embed, allowedMentions, messageReference, components, stickers, options, isSpoiler, embeds); |
|
|
|
/// <exception cref="ArgumentException">The only valid <see cref="MessageFlags"/> are <see cref="MessageFlags.SuppressEmbeds"/> and <see cref="MessageFlags.None"/>.</exception> |
|
|
|
public Task<RestUserMessage> SendFileAsync(string filePath, string text, bool isTTS = false, Embed embed = null, |
|
|
|
RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, |
|
|
|
MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, |
|
|
|
Embed[] embeds = null, MessageFlags flags = MessageFlags.None) |
|
|
|
=> ChannelHelper.SendFileAsync(this, Discord, filePath, text, isTTS, embed, allowedMentions, messageReference, |
|
|
|
components, stickers, options, isSpoiler, embeds, flags); |
|
|
|
/// <inheritdoc /> |
|
|
|
/// <exception cref="ArgumentOutOfRangeException">Message content is too long, length must be less or equal to <see cref="DiscordConfig.MaxMessageSize"/>.</exception> |
|
|
|
public Task<RestUserMessage> SendFileAsync(Stream stream, string filename, string text, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null) |
|
|
|
=> ChannelHelper.SendFileAsync(this, Discord, stream, filename, text, isTTS, embed, allowedMentions, messageReference, components, stickers, options, isSpoiler, embeds); |
|
|
|
/// <exception cref="ArgumentException">The only valid <see cref="MessageFlags"/> are <see cref="MessageFlags.SuppressEmbeds"/> and <see cref="MessageFlags.None"/>.</exception> |
|
|
|
public Task<RestUserMessage> SendFileAsync(Stream stream, string filename, string text, bool isTTS = false, |
|
|
|
Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, |
|
|
|
MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, |
|
|
|
Embed[] embeds = null, MessageFlags flags = MessageFlags.None) |
|
|
|
=> ChannelHelper.SendFileAsync(this, Discord, stream, filename, text, isTTS, embed, allowedMentions, |
|
|
|
messageReference, components, stickers, options, isSpoiler, embeds, flags); |
|
|
|
/// <inheritdoc /> |
|
|
|
/// <exception cref="ArgumentOutOfRangeException">Message content is too long, length must be less or equal to <see cref="DiscordConfig.MaxMessageSize"/>.</exception> |
|
|
|
public Task<RestUserMessage> SendFileAsync(FileAttachment attachment, string text, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null) |
|
|
|
=> ChannelHelper.SendFileAsync(this, Discord, attachment, text, isTTS, embed, allowedMentions, messageReference, components, stickers, options, embeds); |
|
|
|
/// <exception cref="ArgumentException">The only valid <see cref="MessageFlags"/> are <see cref="MessageFlags.SuppressEmbeds"/> and <see cref="MessageFlags.None"/>.</exception> |
|
|
|
public Task<RestUserMessage> SendFileAsync(FileAttachment attachment, string text, bool isTTS = false, |
|
|
|
Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, |
|
|
|
MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, |
|
|
|
Embed[] embeds = null, MessageFlags flags = MessageFlags.None) |
|
|
|
=> ChannelHelper.SendFileAsync(this, Discord, attachment, text, isTTS, embed, allowedMentions, messageReference, |
|
|
|
components, stickers, options, embeds, flags); |
|
|
|
/// <inheritdoc /> |
|
|
|
/// <exception cref="ArgumentOutOfRangeException">Message content is too long, length must be less or equal to <see cref="DiscordConfig.MaxMessageSize"/>.</exception> |
|
|
|
public Task<RestUserMessage> SendFilesAsync(IEnumerable<FileAttachment> attachments, string text, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null) |
|
|
|
=> ChannelHelper.SendFilesAsync(this, Discord, attachments, text, isTTS, embed, allowedMentions, messageReference, components, stickers, options, embeds); |
|
|
|
/// <exception cref="ArgumentException">The only valid <see cref="MessageFlags"/> are <see cref="MessageFlags.SuppressEmbeds"/> and <see cref="MessageFlags.None"/>.</exception> |
|
|
|
public Task<RestUserMessage> SendFilesAsync(IEnumerable<FileAttachment> attachments, string text, bool isTTS = false, |
|
|
|
Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, |
|
|
|
MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, |
|
|
|
Embed[] embeds = null, MessageFlags flags = MessageFlags.None) |
|
|
|
=> ChannelHelper.SendFilesAsync(this, Discord, attachments, text, isTTS, embed, allowedMentions, |
|
|
|
messageReference, components, stickers, options, embeds, flags); |
|
|
|
/// <inheritdoc /> |
|
|
|
public Task TriggerTypingAsync(RequestOptions options = null) |
|
|
|
=> ChannelHelper.TriggerTypingAsync(this, Discord, options); |
|
|
@@ -197,17 +221,41 @@ namespace Discord.Rest |
|
|
|
async Task<IReadOnlyCollection<IMessage>> IMessageChannel.GetPinnedMessagesAsync(RequestOptions options) |
|
|
|
=> await GetPinnedMessagesAsync(options).ConfigureAwait(false); |
|
|
|
|
|
|
|
async Task<IUserMessage> IMessageChannel.SendFileAsync(string filePath, string text, bool isTTS, Embed embed, RequestOptions options, bool isSpoiler, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent components, ISticker[] stickers, Embed[] embeds) |
|
|
|
=> await SendFileAsync(filePath, text, isTTS, embed, options, isSpoiler, allowedMentions, messageReference, components, stickers, embeds).ConfigureAwait(false); |
|
|
|
|
|
|
|
async Task<IUserMessage> IMessageChannel.SendFileAsync(Stream stream, string filename, string text, bool isTTS, Embed embed, RequestOptions options, bool isSpoiler, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent components, ISticker[] stickers, Embed[] embeds) |
|
|
|
=> await SendFileAsync(stream, filename, text, isTTS, embed, options, isSpoiler, allowedMentions, messageReference, components, stickers, embeds).ConfigureAwait(false); |
|
|
|
async Task<IUserMessage> IMessageChannel.SendFileAsync(FileAttachment attachment, string text, bool isTTS, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent components, ISticker[] stickers, Embed[] embeds) |
|
|
|
=> await SendFileAsync(attachment, text, isTTS, embed, options, allowedMentions, messageReference, components, stickers, embeds).ConfigureAwait(false); |
|
|
|
async Task<IUserMessage> IMessageChannel.SendFilesAsync(IEnumerable<FileAttachment> attachments, string text, bool isTTS, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent components, ISticker[] stickers, Embed[] embeds) |
|
|
|
=> await SendFilesAsync(attachments, text, isTTS, embed, options, allowedMentions, messageReference, components, stickers, embeds).ConfigureAwait(false); |
|
|
|
async Task<IUserMessage> IMessageChannel.SendMessageAsync(string text, bool isTTS, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent components, ISticker[] stickers, Embed[] embeds) |
|
|
|
=> await SendMessageAsync(text, isTTS, embed, options, allowedMentions, messageReference, components, stickers, embeds).ConfigureAwait(false); |
|
|
|
/// <inheritdoc /> |
|
|
|
async Task<IUserMessage> IMessageChannel.SendFileAsync(string filePath, string text, bool isTTS, Embed embed, |
|
|
|
RequestOptions options, bool isSpoiler, AllowedMentions allowedMentions, MessageReference messageReference, |
|
|
|
MessageComponent components, ISticker[] stickers, Embed[] embeds, MessageFlags flags) |
|
|
|
=> await SendFileAsync(filePath, text, isTTS, embed, options, isSpoiler, allowedMentions, messageReference, |
|
|
|
components, stickers, embeds, flags).ConfigureAwait(false); |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
async Task<IUserMessage> IMessageChannel.SendFileAsync(Stream stream, string filename, string text, bool isTTS, |
|
|
|
Embed embed, RequestOptions options, bool isSpoiler, AllowedMentions allowedMentions, MessageReference messageReference, |
|
|
|
MessageComponent components, ISticker[] stickers, Embed[] embeds, MessageFlags flags) |
|
|
|
=> await SendFileAsync(stream, filename, text, isTTS, embed, options, isSpoiler, allowedMentions, messageReference, |
|
|
|
components, stickers, embeds, flags).ConfigureAwait(false); |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
async Task<IUserMessage> IMessageChannel.SendFileAsync(FileAttachment attachment, string text, bool isTTS, |
|
|
|
Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageReference messageReference, |
|
|
|
MessageComponent components, ISticker[] stickers, Embed[] embeds, MessageFlags flags) |
|
|
|
=> await SendFileAsync(attachment, text, isTTS, embed, options, allowedMentions, messageReference, components, |
|
|
|
stickers, embeds, flags).ConfigureAwait(false); |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
async Task<IUserMessage> IMessageChannel.SendFilesAsync(IEnumerable<FileAttachment> attachments, string text, |
|
|
|
bool isTTS, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageReference messageReference, |
|
|
|
MessageComponent components, ISticker[] stickers, Embed[] embeds, MessageFlags flags) |
|
|
|
=> await SendFilesAsync(attachments, text, isTTS, embed, options, allowedMentions, messageReference, components, |
|
|
|
stickers, embeds, flags).ConfigureAwait(false); |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
async Task<IUserMessage> IMessageChannel.SendMessageAsync(string text, bool isTTS, Embed embed, RequestOptions options, |
|
|
|
AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent components, |
|
|
|
ISticker[] stickers, Embed[] embeds, MessageFlags flags) |
|
|
|
=> await SendMessageAsync(text, isTTS, embed, options, allowedMentions, messageReference, components, |
|
|
|
stickers, embeds, flags).ConfigureAwait(false); |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
#region IAudioChannel |
|
|
|