Skip to main content

Interface ITextChannel

Represents a generic channel in a guild that can send and receive messages.

Assembly: Discord.Net.Core.dll​
View Source​
Declaration
public interface ITextChannel : IMessageChannel, IMentionable, INestedChannel, IGuildChannel, IChannel, ISnowflakeEntity, IEntity<ulong>, IDeletable

Properties​

IsNsfw​

Gets a value that indicates whether the channel is NSFW.

View Source​
Declaration
bool IsNsfw { get; }

Topic​

Gets the current topic for this text channel.

View Source​
Declaration
string Topic { get; }

SlowModeInterval​

Gets the current slow-mode delay for this channel.

View Source​
Declaration
int SlowModeInterval { get; }

Methods​

DeleteMessagesAsync(IEnumerable<IMessage>, RequestOptions)​

Bulk-deletes multiple messages.

View Source​
Declaration
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
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.

ModifyAsync(Action<TextChannelProperties>, RequestOptions)​

Modifies this text channel.

View Source​
Declaration
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.

CreateWebhookAsync(String, Stream, RequestOptions)​

Creates a webhook in this text channel.

View Source​
Declaration
Task<IWebhook> CreateWebhookAsync(string name, Stream avatar = null, RequestOptions options = null)
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.

GetWebhookAsync(UInt64, RequestOptions)​

Gets a webhook available in this text channel.

View Source​
Declaration
Task<IWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
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.

GetWebhooksAsync(RequestOptions)​

Gets the webhooks available in this text channel.

View Source​
Declaration
Task<IReadOnlyCollection<IWebhook>> GetWebhooksAsync(RequestOptions options = null)
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.

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

Creates a thread within this Discord.ITextChannel.

View Source​
Declaration
Task<IThreadChannel> 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.IThreadChannel>: 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 | Whether non-moderators can add other non-moderators to a thread; only available when creating a private thread | | System.Nullable<System.Int32> | slowmode | The amount of seconds a user has to wait before sending another message (0-21600) | | Discord.RequestOptions | options | The options to be used when sending the request. |