Skip to main content

Class RestTextChannel

Represents a REST-based channel in a guild that can send and receive messages.

Assembly: Discord.Net.Rest.dll​
View Source​
Declaration
public class RestTextChannel : RestGuildChannel, IUpdateable, IRestMessageChannel, ITextChannel, IMessageChannel, IMentionable, INestedChannel, IGuildChannel, IChannel, ISnowflakeEntity, IEntity<ulong>, IDeletable

Properties​

Topic​

Gets the current topic for this text channel.

View Source​
Declaration
public string Topic { get; }

SlowModeInterval​

Gets the current slow-mode delay for this channel.

View Source​
Declaration
public virtual int SlowModeInterval { get; }

CategoryId​

Gets the parent (category) ID of this channel in the guild's channel list.

View Source​
Declaration
public ulong? CategoryId { get; }

Mention​

Returns a special string used to mention this object.

View Source​
Declaration
public string Mention { get; }

IsNsfw​

Gets a value that indicates whether the channel is NSFW.

View Source​
Declaration
public bool IsNsfw { get; }

Methods​

ModifyAsync(Action<TextChannelProperties>, RequestOptions)​

Modifies this text channel.

View Source​
Declaration
public virtual async Task ModifyAsync(Action<TextChannelProperties> func, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous modification operation.

Parameters​
TypeNameDescription
System.Action<Discord.TextChannelProperties>funcThe delegate containing the properties to modify the channel with.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetUserAsync(UInt64, RequestOptions)​

Gets a user in this channel.

View Source​
Declaration
public Task<RestGuildUser> GetUserAsync(ulong id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestGuildUser>: A task representing the asynchronous get operation. The task result contains a guild user object that represents the user; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier of the user.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetUsersAsync(RequestOptions)​

Gets a collection of users that are able to view the channel.

View Source​
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestGuildUser>> GetUsersAsync(RequestOptions options = null)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuildUser>>: A paged collection containing a collection of guild users that can access this channel. Flattening the paginated response into a collection of users with Discord.AsyncEnumerableExtensions.FlattenAsync%60%601(System.Collections.Generic.IAsyncEnumerable%7bSystem.Collections.Generic.IEnumerable%7b%60%600%7d%7d) is required if you wish to access the users.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetMessageAsync(UInt64, RequestOptions)​

Gets a message from this message channel.

View Source​
Declaration
public Task<RestMessage> GetMessageAsync(ulong id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestMessage>: A task that represents an asynchronous get operation for retrieving the message. The task result contains the retrieved message; null if no message is found with the specified identifier.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier of the message.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetMessagesAsync(Int32, RequestOptions)​

Gets the last N messages from this message channel.

View Source​
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestMessage>> GetMessagesAsync(int limit = 100, RequestOptions options = null)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestMessage>>: Paged collection of messages.

Parameters​
TypeNameDescription
System.Int32limitThe numbers of message to be gotten from.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetMessagesAsync(UInt64, Direction, Int32, RequestOptions)​

Gets a collection of messages in this channel.

View Source​
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestMessage>> GetMessagesAsync(ulong fromMessageId, Direction dir, int limit = 100, RequestOptions options = null)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestMessage>>: Paged collection of messages.

Parameters​
TypeNameDescription
System.UInt64fromMessageIdThe ID of the starting message to get the messages from.
Discord.DirectiondirThe direction of the messages to be gotten from.
System.Int32limitThe numbers of message to be gotten from.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetMessagesAsync(IMessage, Direction, Int32, RequestOptions)​

Gets a collection of messages in this channel.

View Source​
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestMessage>> GetMessagesAsync(IMessage fromMessage, Direction dir, int limit = 100, RequestOptions options = null)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestMessage>>: Paged collection of messages.

Parameters​
TypeNameDescription
Discord.IMessagefromMessageThe starting message to get the messages from.
Discord.DirectiondirThe direction of the messages to be gotten from.
System.Int32limitThe numbers of message to be gotten from.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetPinnedMessagesAsync(RequestOptions)​

Gets a collection of pinned messages in this channel.

View Source​
Declaration
public Task<IReadOnlyCollection<RestMessage>> GetPinnedMessagesAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestMessage>>: A task that represents the asynchronous get operation for retrieving pinned messages in this channel. The task result contains a collection of messages found in the pinned messages.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

SendMessageAsync(String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

Sends a message to this message channel.

View Source​
Declaration
public Task<RestUserMessage> SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent component = null, ISticker[] stickers = null, Embed[] embeds = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestUserMessage>: A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.

Parameters​
TypeNameDescription
System.StringtextThe message to be sent.
System.BooleanisTTSDetermines whether the message should be read aloud by Discord or not.
Discord.EmbedembedThe Discord.EmbedType.Rich Discord.Embed to be sent.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
Discord.AllowedMentionsallowedMentions

Specifies if notifications are sent for mentioned users and roles in the message <code data-dev-comment-type="paramref" class="paramref">text</code>. If null, all mentioned roles and users will be notified. | | Discord.MessageReference | messageReference | The message references to be included. Used to reply to specific messages. | | Discord.MessageComponent | component | The message components to be included with this message. Used for interactions. | | Discord.ISticker[] | stickers | A collection of stickers to send with the message. | | Discord.Embed[] | embeds | A array of Discord.Embeds to send with this response. Max 10. |

SendFileAsync(String, String, Boolean, Embed, RequestOptions, Boolean, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

Sends a file to this message channel with an optional caption.

View Source​
Declaration
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 component = null, ISticker[] stickers = null, Embed[] embeds = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestUserMessage>: A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.

Parameters​
TypeNameDescription
System.StringfilePathThe file path of the file.
System.StringtextThe message to be sent.
System.BooleanisTTSWhether the message should be read aloud by Discord or not.
Discord.EmbedembedThe Discord.EmbedType.Rich Discord.Embed to be sent.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
System.BooleanisSpoilerWhether the message attachment should be hidden as a spoiler.
Discord.AllowedMentionsallowedMentions

Specifies if notifications are sent for mentioned users and roles in the message <code data-dev-comment-type="paramref" class="paramref">text</code>. If null, all mentioned roles and users will be notified. | | Discord.MessageReference | messageReference | The message references to be included. Used to reply to specific messages. | | Discord.MessageComponent | component | The message components to be included with this message. Used for interactions. | | Discord.ISticker[] | stickers | A collection of stickers to send with the message. | | Discord.Embed[] | embeds | A array of Discord.Embeds to send with this response. Max 10. |

SendFileAsync(Stream, String, String, Boolean, Embed, RequestOptions, Boolean, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

Sends a file to this message channel with an optional caption.

View Source​
Declaration
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 component = null, ISticker[] stickers = null, Embed[] embeds = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestUserMessage>: A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.

Parameters​
TypeNameDescription
System.IO.StreamstreamThe System.IO.Stream of the file to be sent.
System.StringfilenameThe name of the attachment.
System.StringtextThe message to be sent.
System.BooleanisTTSWhether the message should be read aloud by Discord or not.
Discord.EmbedembedThe Discord.EmbedType.Rich Discord.Embed to be sent.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
System.BooleanisSpoilerWhether the message attachment should be hidden as a spoiler.
Discord.AllowedMentionsallowedMentions

Specifies if notifications are sent for mentioned users and roles in the message <code data-dev-comment-type="paramref" class="paramref">text</code>. If null, all mentioned roles and users will be notified. | | Discord.MessageReference | messageReference | The message references to be included. Used to reply to specific messages. | | Discord.MessageComponent | component | The message components to be included with this message. Used for interactions. | | Discord.ISticker[] | stickers | A collection of stickers to send with the message. | | Discord.Embed[] | embeds | A array of Discord.Embeds to send with this response. Max 10. |

SendFileAsync(FileAttachment, String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

View Source​
Declaration
public Task<RestUserMessage> SendFileAsync(FileAttachment attachment, string text, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent component = null, ISticker[] stickers = null, Embed[] embeds = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestUserMessage>

Parameters​
TypeName
Discord.FileAttachmentattachment
System.Stringtext
System.BooleanisTTS
Discord.Embedembed
Discord.RequestOptionsoptions
Discord.AllowedMentionsallowedMentions
Discord.MessageReferencemessageReference
Discord.MessageComponentcomponent
Discord.ISticker[]stickers
Discord.Embed[]embeds

SendFilesAsync(IEnumerable<FileAttachment>, String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

View Source​
Declaration
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 component = null, ISticker[] stickers = null, Embed[] embeds = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestUserMessage>

Parameters​
TypeName
System.Collections.Generic.IEnumerable<Discord.FileAttachment>attachments
System.Stringtext
System.BooleanisTTS
Discord.Embedembed
Discord.RequestOptionsoptions
Discord.AllowedMentionsallowedMentions
Discord.MessageReferencemessageReference
Discord.MessageComponentcomponent
Discord.ISticker[]stickers
Discord.Embed[]embeds

DeleteMessageAsync(UInt64, RequestOptions)​

Deletes a message.

View Source​
Declaration
public Task DeleteMessageAsync(ulong messageId, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous removal operation.

Parameters​
TypeNameDescription
System.UInt64messageIdThe snowflake identifier of the message that would be removed.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

DeleteMessageAsync(IMessage, RequestOptions)​

Deletes a message based on the provided message in this channel.

View Source​
Declaration
public Task DeleteMessageAsync(IMessage message, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous removal operation.

Parameters​
TypeNameDescription
Discord.IMessagemessageThe message that would be removed.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

DeleteMessagesAsync(IEnumerable<IMessage>, RequestOptions)​

Bulk-deletes multiple messages.

View Source​
Declaration
public Task DeleteMessagesAsync(IEnumerable<IMessage> messages, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous bulk-removal operation.

Parameters​
TypeNameDescription
System.Collections.Generic.IEnumerable<Discord.IMessage>messagesThe messages to be bulk-deleted.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

DeleteMessagesAsync(IEnumerable<UInt64>, RequestOptions)​

Bulk-deletes multiple messages.

View Source​
Declaration
public Task DeleteMessagesAsync(IEnumerable<ulong> messageIds, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous bulk-removal operation.

Parameters​
TypeNameDescription
System.Collections.Generic.IEnumerable<System.UInt64>messageIdsThe snowflake identifier of the messages to be bulk-deleted.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ModifyMessageAsync(UInt64, Action<MessageProperties>, RequestOptions)​

Modifies a message.

View Source​
Declaration
public async Task<IUserMessage> ModifyMessageAsync(ulong messageId, Action<MessageProperties> func, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.IUserMessage>: A task that represents the asynchronous modification operation.

Parameters​
TypeNameDescription
System.UInt64messageIdThe snowflake identifier of the message that would be changed.
System.Action<Discord.MessageProperties>funcA delegate containing the properties to modify the message with.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

TriggerTypingAsync(RequestOptions)​

Broadcasts the "user is typing" message to all users in this channel, lasting 10 seconds.

View Source​
Declaration
public Task TriggerTypingAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous operation that triggers the broadcast.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

EnterTypingState(RequestOptions)​

Continuously broadcasts the "user is typing" message to all users in this channel until the returned object is disposed.

View Source​
Declaration
public IDisposable EnterTypingState(RequestOptions options = null)
Returns​

System.IDisposable: A disposable object that, upon its disposal, will stop the client from broadcasting its typing state in this channel.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CreateWebhookAsync(String, Stream, RequestOptions)​

Creates a webhook in this text channel.

View Source​
Declaration
public virtual Task<RestWebhook> CreateWebhookAsync(string name, Stream avatar = null, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestWebhook>: A task that represents the asynchronous creation operation. The task result contains the newly created webhook.

Parameters​
TypeNameDescription
System.StringnameThe name of the webhook.
System.IO.StreamavatarThe avatar of the webhook.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetWebhookAsync(UInt64, RequestOptions)​

Gets a webhook available in this text channel.

View Source​
Declaration
public virtual Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestWebhook>: A task that represents the asynchronous get operation. The task result contains a webhook associated with the identifier; null if the webhook is not found.

Parameters​
TypeNameDescription
System.UInt64idThe identifier of the webhook.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetWebhooksAsync(RequestOptions)​

Gets the webhooks available in this text channel.

View Source​
Declaration
public virtual Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestWebhook>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of webhooks that is available in this channel.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetCategoryAsync(RequestOptions)​

Gets the parent (category) channel of this channel.

View Source​
Declaration
public virtual Task<ICategoryChannel> GetCategoryAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.ICategoryChannel>: A task that represents the asynchronous get operation. The task result contains the category channel representing the parent of this channel; null if none is set.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

SyncPermissionsAsync(RequestOptions)​

Syncs the permissions of this nested channel with its parent's.

View Source​
Declaration
public Task SyncPermissionsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous operation for syncing channel permissions with its parent's.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CreateInviteAsync(Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, RequestOptions)​

Creates a new invite to this channel.

View Source​
Declaration
public virtual async Task<IInviteMetadata> CreateInviteAsync(int? maxAge = 86400, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.IInviteMetadata>: A task that represents the asynchronous invite creation operation. The task result contains an invite metadata object containing information for the created invite.

Parameters​
TypeNameDescription
System.Nullable<System.Int32>maxAgeThe time (in seconds) until the invite expires. Set to null to never expire.
System.Nullable<System.Int32>maxUsesThe max amount of times this invite may be used. Set to null to have unlimited uses.
System.BooleanisTemporaryIf true, the user accepting this invite will be kicked from the guild after closing their client.
System.BooleanisUniqueIf true, don't try to reuse a similar invite (useful for creating many unique one time use invites).
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CreateInviteToApplicationAsync(UInt64, Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, RequestOptions)​

View Source​
Declaration
public virtual async Task<IInviteMetadata> CreateInviteToApplicationAsync(ulong applicationId, int? maxAge = 86400, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.IInviteMetadata>

Parameters​
TypeName
System.UInt64applicationId
System.Nullable<System.Int32>maxAge
System.Nullable<System.Int32>maxUses
System.BooleanisTemporary
System.BooleanisUnique
Discord.RequestOptionsoptions

CreateInviteToApplicationAsync(DefaultApplications, Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, RequestOptions)​

Creates a new invite to this channel.

View Source​
Declaration
public virtual async Task<IInviteMetadata> CreateInviteToApplicationAsync(DefaultApplications application, int? maxAge = 86400, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.IInviteMetadata>: A task that represents the asynchronous invite creation operation. The task result contains an invite metadata object containing information for the created invite.

Parameters​
TypeNameDescription
Discord.DefaultApplicationsapplicationThe application to open for this invite.
System.Nullable<System.Int32>maxAgeThe time (in seconds) until the invite expires. Set to null to never expire.
System.Nullable<System.Int32>maxUsesThe max amount of times this invite may be used. Set to null to have unlimited uses.
System.BooleanisTemporaryIf true, the user accepting this invite will be kicked from the guild after closing their client.
System.BooleanisUniqueIf true, don't try to reuse a similar invite (useful for creating many unique one time use invites).
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CreateInviteToStreamAsync(IUser, Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, RequestOptions)​

View Source​
Declaration
public virtual Task<IInviteMetadata> CreateInviteToStreamAsync(IUser user, int? maxAge, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.IInviteMetadata>

Parameters​
TypeName
Discord.IUseruser
System.Nullable<System.Int32>maxAge
System.Nullable<System.Int32>maxUses
System.BooleanisTemporary
System.BooleanisUnique
Discord.RequestOptionsoptions

GetInvitesAsync(RequestOptions)​

Gets a collection of all invites to this channel.

View Source​
Declaration
public virtual async Task<IReadOnlyCollection<IInviteMetadata>> GetInvitesAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IInviteMetadata>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of invite metadata that are created for this channel.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CreateThreadAsync(String, ThreadType, ThreadArchiveDuration, IMessage, Nullable<Boolean>, Nullable<Int32>, RequestOptions)​

Creates a thread within this Discord.ITextChannel.

View Source​
Declaration
public async Task<RestThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay, IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestThreadChannel>: A task that represents the asynchronous create operation. The task result contains a Discord.IThreadChannel

Parameters​
TypeNameDescription
System.StringnameThe name of the thread.
Discord.ThreadTypetype

The type of the thread. <p> <strong>Note: </strong>This parameter is not used if the <code data-dev-comment-type="paramref" class="paramref">message</code> parameter is not specified. </p> | | Discord.ThreadArchiveDuration | autoArchiveDuration | The duration on which this thread archives after. <p> <strong>Note: </strong> Options Discord.ThreadArchiveDuration.OneWeek and Discord.ThreadArchiveDuration.ThreeDays are only available for guilds that are boosted. You can check in the Discord.IGuild.Features to see if the guild has the <strong>THREE_DAY_THREAD_ARCHIVE</strong> and <strong>SEVEN_DAY_THREAD_ARCHIVE</strong>. </p> | | Discord.IMessage | message | The message which to start the thread from. | | System.Nullable<System.Boolean> | invitable | | | System.Nullable<System.Int32> | slowmode | | | Discord.RequestOptions | options | The options to be used when sending the request. |

ITextChannel.CreateWebhookAsync(String, Stream, RequestOptions)​

Creates a webhook in this text channel.

View Source​
Declaration
async Task<IWebhook> ITextChannel.CreateWebhookAsync(string name, Stream avatar, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IWebhook>: A task that represents the asynchronous creation operation. The task result contains the newly created webhook.

Parameters​
TypeNameDescription
System.StringnameThe name of the webhook.
System.IO.StreamavatarThe avatar of the webhook.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ITextChannel.GetWebhookAsync(UInt64, RequestOptions)​

Gets a webhook available in this text channel.

View Source​
Declaration
async Task<IWebhook> ITextChannel.GetWebhookAsync(ulong id, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IWebhook>: A task that represents the asynchronous get operation. The task result contains a webhook associated with the identifier; null if the webhook is not found.

Parameters​
TypeNameDescription
System.UInt64idThe identifier of the webhook.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ITextChannel.GetWebhooksAsync(RequestOptions)​

Gets the webhooks available in this text channel.

View Source​
Declaration
async Task<IReadOnlyCollection<IWebhook>> ITextChannel.GetWebhooksAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IWebhook>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of webhooks that is available in this channel.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ITextChannel.CreateThreadAsync(String, ThreadType, ThreadArchiveDuration, IMessage, Nullable<Boolean>, Nullable<Int32>, RequestOptions)​

View Source​
Declaration
async Task<IThreadChannel> ITextChannel.CreateThreadAsync(string name, ThreadType type, ThreadArchiveDuration autoArchiveDuration, IMessage message, bool? invitable, int? slowmode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IThreadChannel>

Parameters​
TypeName
System.Stringname
Discord.ThreadTypetype
Discord.ThreadArchiveDurationautoArchiveDuration
Discord.IMessagemessage
System.Nullable<System.Boolean>invitable
System.Nullable<System.Int32>slowmode
Discord.RequestOptionsoptions

IMessageChannel.GetMessageAsync(UInt64, CacheMode, RequestOptions)​

Gets a message from this message channel.

View Source​
Declaration
async Task<IMessage> IMessageChannel.GetMessageAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IMessage>: A task that represents an asynchronous get operation for retrieving the message. The task result contains the retrieved message; null if no message is found with the specified identifier.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier of the message.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IMessageChannel.GetMessagesAsync(Int32, CacheMode, RequestOptions)​

Gets the last N messages from this message channel.

View Source​
Declaration
IAsyncEnumerable<IReadOnlyCollection<IMessage>> IMessageChannel.GetMessagesAsync(int limit, CacheMode mode, RequestOptions options)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IMessage>>: Paged collection of messages.

Parameters​
TypeNameDescription
System.Int32limitThe numbers of message to be gotten from.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from
cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IMessageChannel.GetMessagesAsync(UInt64, Direction, Int32, CacheMode, RequestOptions)​

Gets a collection of messages in this channel.

View Source​
Declaration
IAsyncEnumerable<IReadOnlyCollection<IMessage>> IMessageChannel.GetMessagesAsync(ulong fromMessageId, Direction dir, int limit, CacheMode mode, RequestOptions options)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IMessage>>: Paged collection of messages.

Parameters​
TypeNameDescription
System.UInt64fromMessageIdThe ID of the starting message to get the messages from.
Discord.DirectiondirThe direction of the messages to be gotten from.
System.Int32limitThe numbers of message to be gotten from.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from
cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IMessageChannel.GetMessagesAsync(IMessage, Direction, Int32, CacheMode, RequestOptions)​

Gets a collection of messages in this channel.

View Source​
Declaration
IAsyncEnumerable<IReadOnlyCollection<IMessage>> IMessageChannel.GetMessagesAsync(IMessage fromMessage, Direction dir, int limit, CacheMode mode, RequestOptions options)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IMessage>>: Paged collection of messages.

Parameters​
TypeNameDescription
Discord.IMessagefromMessageThe starting message to get the messages from.
Discord.DirectiondirThe direction of the messages to be gotten from.
System.Int32limitThe numbers of message to be gotten from.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from
cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IMessageChannel.GetPinnedMessagesAsync(RequestOptions)​

Gets a collection of pinned messages in this channel.

View Source​
Declaration
async Task<IReadOnlyCollection<IMessage>> IMessageChannel.GetPinnedMessagesAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IMessage>>: A task that represents the asynchronous get operation for retrieving pinned messages in this channel. The task result contains a collection of messages found in the pinned messages.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IMessageChannel.SendFileAsync(String, String, Boolean, Embed, RequestOptions, Boolean, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

Sends a file to this message channel with an optional caption.

View Source​
Declaration
async Task<IUserMessage> IMessageChannel.SendFileAsync(string filePath, string text, bool isTTS, Embed embed, RequestOptions options, bool isSpoiler, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent component, ISticker[] stickers, Embed[] embeds)
Returns​

System.Threading.Tasks.Task<Discord.IUserMessage>: A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.

Parameters​
TypeNameDescription
System.StringfilePathThe file path of the file.
System.StringtextThe message to be sent.
System.BooleanisTTSWhether the message should be read aloud by Discord or not.
Discord.EmbedembedThe Discord.EmbedType.Rich Discord.Embed to be sent.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
System.BooleanisSpoilerWhether the message attachment should be hidden as a spoiler.
Discord.AllowedMentionsallowedMentions

Specifies if notifications are sent for mentioned users and roles in the message <code data-dev-comment-type="paramref" class="paramref">text</code>. If null, all mentioned roles and users will be notified. | | Discord.MessageReference | messageReference | The message references to be included. Used to reply to specific messages. | | Discord.MessageComponent | component | The message components to be included with this message. Used for interactions. | | Discord.ISticker[] | stickers | A collection of stickers to send with the file. | | Discord.Embed[] | embeds | A array of Discord.Embeds to send with this response. Max 10. |

IMessageChannel.SendFileAsync(Stream, String, String, Boolean, Embed, RequestOptions, Boolean, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

Sends a file to this message channel with an optional caption.

View Source​
Declaration
async Task<IUserMessage> IMessageChannel.SendFileAsync(Stream stream, string filename, string text, bool isTTS, Embed embed, RequestOptions options, bool isSpoiler, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent component, ISticker[] stickers, Embed[] embeds)
Returns​

System.Threading.Tasks.Task<Discord.IUserMessage>: A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.

Parameters​
TypeNameDescription
System.IO.StreamstreamThe System.IO.Stream of the file to be sent.
System.StringfilenameThe name of the attachment.
System.StringtextThe message to be sent.
System.BooleanisTTSWhether the message should be read aloud by Discord or not.
Discord.EmbedembedThe Discord.EmbedType.Rich Discord.Embed to be sent.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
System.BooleanisSpoilerWhether the message attachment should be hidden as a spoiler.
Discord.AllowedMentionsallowedMentions

Specifies if notifications are sent for mentioned users and roles in the message <code data-dev-comment-type="paramref" class="paramref">text</code>. If null, all mentioned roles and users will be notified. | | Discord.MessageReference | messageReference | The message references to be included. Used to reply to specific messages. | | Discord.MessageComponent | component | The message components to be included with this message. Used for interactions. | | Discord.ISticker[] | stickers | A collection of stickers to send with the file. | | Discord.Embed[] | embeds | A array of Discord.Embeds to send with this response. Max 10. |

IMessageChannel.SendFileAsync(FileAttachment, String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

Sends a file to this message channel with an optional caption.

View Source​
Declaration
async Task<IUserMessage> IMessageChannel.SendFileAsync(FileAttachment attachment, string text, bool isTTS, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent component, ISticker[] stickers, Embed[] embeds)
Returns​

System.Threading.Tasks.Task<Discord.IUserMessage>: A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.

Parameters​
TypeNameDescription
Discord.FileAttachmentattachmentThe attachment containing the file and description.
System.StringtextThe message to be sent.
System.BooleanisTTSWhether the message should be read aloud by Discord or not.
Discord.EmbedembedThe Discord.EmbedType.Rich Discord.Embed to be sent.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
Discord.AllowedMentionsallowedMentions

Specifies if notifications are sent for mentioned users and roles in the message <code data-dev-comment-type="paramref" class="paramref">text</code>. If null, all mentioned roles and users will be notified. | | Discord.MessageReference | messageReference | The message references to be included. Used to reply to specific messages. | | Discord.MessageComponent | component | The message components to be included with this message. Used for interactions. | | Discord.ISticker[] | stickers | A collection of stickers to send with the file. | | Discord.Embed[] | embeds | A array of Discord.Embeds to send with this response. Max 10. |

IMessageChannel.SendFilesAsync(IEnumerable<FileAttachment>, String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

Sends a collection of files to this message channel.

View Source​
Declaration
async Task<IUserMessage> IMessageChannel.SendFilesAsync(IEnumerable<FileAttachment> attachments, string text, bool isTTS, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent component, ISticker[] stickers, Embed[] embeds)
Returns​

System.Threading.Tasks.Task<Discord.IUserMessage>: A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.

Parameters​
TypeNameDescription
System.Collections.Generic.IEnumerable<Discord.FileAttachment>attachmentsA collection of attachments to upload.
System.StringtextThe message to be sent.
System.BooleanisTTSWhether the message should be read aloud by Discord or not.
Discord.EmbedembedThe Discord.EmbedType.Rich Discord.Embed to be sent.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
Discord.AllowedMentionsallowedMentions

Specifies if notifications are sent for mentioned users and roles in the message <code data-dev-comment-type="paramref" class="paramref">text</code>. If null, all mentioned roles and users will be notified. | | Discord.MessageReference | messageReference | The message references to be included. Used to reply to specific messages. | | Discord.MessageComponent | component | The message components to be included with this message. Used for interactions. | | Discord.ISticker[] | stickers | A collection of stickers to send with the file. | | Discord.Embed[] | embeds | A array of Discord.Embeds to send with this response. Max 10. |

IMessageChannel.SendMessageAsync(String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

Sends a message to this message channel.

View Source​
Declaration
async Task<IUserMessage> IMessageChannel.SendMessageAsync(string text, bool isTTS, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent component, ISticker[] stickers, Embed[] embeds)
Returns​

System.Threading.Tasks.Task<Discord.IUserMessage>: A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.

Parameters​
TypeNameDescription
System.StringtextThe message to be sent.
System.BooleanisTTSDetermines whether the message should be read aloud by Discord or not.
Discord.EmbedembedThe Discord.EmbedType.Rich Discord.Embed to be sent.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
Discord.AllowedMentionsallowedMentions

Specifies if notifications are sent for mentioned users and roles in the message <code data-dev-comment-type="paramref" class="paramref">text</code>. If null, all mentioned roles and users will be notified. | | Discord.MessageReference | messageReference | The message references to be included. Used to reply to specific messages. | | Discord.MessageComponent | component | The message components to be included with this message. Used for interactions. | | Discord.ISticker[] | stickers | A collection of stickers to send with the message. | | Discord.Embed[] | embeds | A array of Discord.Embeds to send with this response. Max 10. |

IGuildChannel.GetUserAsync(UInt64, CacheMode, RequestOptions)​

Gets a user in this channel.

View Source​
Declaration
async Task<IGuildUser> IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IGuildUser>: A task representing the asynchronous get operation. The task result contains a guild user object that represents the user; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier of the user.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuildChannel.GetUsersAsync(CacheMode, RequestOptions)​

Gets a collection of users that are able to view the channel or are currently in this channel.

View Source​
Declaration
IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildUser>>: Paged collection of users.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IChannel.GetUserAsync(UInt64, CacheMode, RequestOptions)​

Gets a user in this channel.

View Source​
Declaration
async Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IUser>: A task that represents the asynchronous get operation. The task result contains a user object that represents the found user; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier of the user (e.g. 168693960628371456).
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IChannel.GetUsersAsync(CacheMode, RequestOptions)​

Gets a collection of users that are able to view the channel or are currently in this channel.

View Source​
Declaration
IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IUser>>: Paged collection of users.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

INestedChannel.GetCategoryAsync(CacheMode, RequestOptions)​

Gets the parent (category) channel of this channel.

View Source​
Declaration
async Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.ICategoryChannel>: A task that represents the asynchronous get operation. The task result contains the category channel representing the parent of this channel; null if none is set.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

Implements​