Show / Hide Table of Contents

# Interface ITextChannel

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

##### Inherited Members

IMessageChannel.SendMessageAsync(String, Boolean, Embed, RequestOptions)
IMessageChannel.SendFileAsync(String, String, Boolean, Embed, RequestOptions, Boolean)
IMessageChannel.SendFileAsync(Stream, String, String, Boolean, Embed, RequestOptions, Boolean)
IMessageChannel.GetMessageAsync(UInt64, CacheMode, RequestOptions)
IMessageChannel.GetMessagesAsync(Int32, CacheMode, RequestOptions)
IMessageChannel.GetMessagesAsync(UInt64, Direction, Int32, CacheMode, RequestOptions)
IMessageChannel.GetMessagesAsync(IMessage, Direction, Int32, CacheMode, RequestOptions)
IMessageChannel.GetPinnedMessagesAsync(RequestOptions)
IMessageChannel.DeleteMessageAsync(UInt64, RequestOptions)
IMessageChannel.DeleteMessageAsync(IMessage, RequestOptions)
IMessageChannel.TriggerTypingAsync(RequestOptions)
IMessageChannel.EnterTypingState(RequestOptions)
IMentionable.Mention
INestedChannel.CategoryId
INestedChannel.GetCategoryAsync(CacheMode, RequestOptions)
INestedChannel.SyncPermissionsAsync(RequestOptions)
INestedChannel.CreateInviteAsync(Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, RequestOptions)
INestedChannel.GetInvitesAsync(RequestOptions)
IGuildChannel.Position
IGuildChannel.Guild
IGuildChannel.GuildId
IGuildChannel.PermissionOverwrites
IGuildChannel.ModifyAsync(Action<GuildChannelProperties>, RequestOptions)
IGuildChannel.GetPermissionOverwrite(IRole)
IGuildChannel.GetPermissionOverwrite(IUser)
IGuildChannel.RemovePermissionOverwriteAsync(IRole, RequestOptions)
IGuildChannel.RemovePermissionOverwriteAsync(IUser, RequestOptions)
IGuildChannel.AddPermissionOverwriteAsync(IRole, OverwritePermissions, RequestOptions)
IGuildChannel.AddPermissionOverwriteAsync(IUser, OverwritePermissions, RequestOptions)
IGuildChannel.GetUsersAsync(CacheMode, RequestOptions)
IGuildChannel.GetUserAsync(UInt64, CacheMode, RequestOptions)
IChannel.Name
ISnowflakeEntity.CreatedAt
IEntity<UInt64>.Id
IDeletable.DeleteAsync(RequestOptions)

###### Namespace: Discord

###### Assembly: Discord.Net.Core.dll

##### Syntax

    public interface ITextChannel : IMessageChannel, IMentionable, INestedChannel, IGuildChannel, IChannel, ISnowflakeEntity, IEntity<ulong>, IDeletable

### Properties

| Improve this Doc View Source

#### IsNsfw

Gets a value that indicates whether the channel is NSFW.

##### Declaration

    bool IsNsfw { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean | `true` if the channel has the NSFW flag enabled; otherwise `false`.

| Improve this Doc View Source

#### SlowModeInterval

Gets the current slow-mode delay for this channel.

##### Declaration

    int SlowModeInterval { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 | An System.Int32 representing the time in seconds required before the user can send another message; `0` if disabled.

| Improve this Doc View Source

#### Topic

Gets the current topic for this text channel.

##### Declaration

    string Topic { get; }

##### Property Value

Type | Description
--- | ---
System.String | A string representing the topic set in the channel; `null` if none is set.

### Methods

| Improve this Doc View Source

#### CreateWebhookAsync(String, Stream, RequestOptions)

Creates a webhook in this text channel.

##### Declaration

    Task<IWebhook> CreateWebhookAsync(string name, Stream avatar = null, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name | The name of the webhook.
System.IO.Stream | avatar | The avatar of the webhook.
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<IWebhook> | A task that represents the asynchronous creation operation. The task result contains the newly created webhook.

| Improve this Doc View Source

#### DeleteMessagesAsync(IEnumerable<IMessage>, RequestOptions)

Bulk-deletes multiple messages.

##### Declaration

    Task DeleteMessagesAsync(IEnumerable<IMessage> messages, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Collections.Generic.IEnumerable<IMessage> | messages | The messages to be bulk-deleted.
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | A task that represents the asynchronous bulk-removal operation.

##### Remarks

This method attempts to remove the messages specified in bulk.

##### important

Due to the limitation set by Discord, this method can only remove messages that are posted within 14 days!

##### Examples

The following example gets 250 messages from the channel and deletes them.

    var messages = await textChannel.GetMessagesAsync(250).FlattenAsync();
    await textChannel.DeleteMessagesAsync(messages);

| Improve this Doc View Source

#### DeleteMessagesAsync(IEnumerable<UInt64>, RequestOptions)

Bulk-deletes multiple messages.

##### Declaration

    Task DeleteMessagesAsync(IEnumerable<ulong> messageIds, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Collections.Generic.IEnumerable<System.UInt64> | messageIds | The snowflake identifier of the messages to be bulk-deleted.
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | A task that represents the asynchronous bulk-removal operation.

##### Remarks

This method attempts to remove the messages specified in bulk.

##### important

Due to the limitation set by Discord, this method can only remove messages that are posted within 14 days!

| Improve this Doc View Source

#### GetWebhookAsync(UInt64, RequestOptions)

Gets a webhook available in this text channel.

##### Declaration

    Task<IWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.UInt64 | id | The identifier of the webhook.
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<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.

| Improve this Doc View Source

#### GetWebhooksAsync(RequestOptions)

Gets the webhooks available in this text channel.

##### Declaration

    Task<IReadOnlyCollection<IWebhook>> GetWebhooksAsync(RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<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.

| Improve this Doc View Source

#### ModifyAsync(Action<TextChannelProperties>, RequestOptions)

Modifies this text channel.

##### Declaration

    Task ModifyAsync(Action<TextChannelProperties> func, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Action<TextChannelProperties> | func | The delegate containing the properties to modify the channel with.
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | A task that represents the asynchronous modification operation.

##### See Also

TextChannelProperties