Interface ITextChannel
Represents a generic channel in a guild that can send and receive messages.
Assembly: Discord.Net.Core.dll​
View Source​
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​
bool IsNsfw { get; }
Topic​
Gets the current topic for this text channel.
View Source​
string Topic { get; }
SlowModeInterval​
Gets the current slow-mode delay for this channel.
View Source​
int SlowModeInterval { get; }
Methods​
DeleteMessagesAsync(IEnumerable<IMessage>, RequestOptions)​
Bulk-deletes multiple messages.
View Source​
Task DeleteMessagesAsync(IEnumerable<IMessage> messages, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous bulk-removal operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Discord.IMessage> | messages | The messages to be bulk-deleted. |
Discord.RequestOptions | options | The options to be used when sending the request. |
DeleteMessagesAsync(IEnumerable<UInt64>, RequestOptions)​
Bulk-deletes multiple messages.
View Source​
Task DeleteMessagesAsync(IEnumerable<ulong> messageIds, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous bulk-removal operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.UInt64> | messageIds | The snowflake identifier of the messages to be bulk-deleted. |
Discord.RequestOptions | options | The options to be used when sending the request. |
ModifyAsync(Action<TextChannelProperties>, RequestOptions)​
Modifies this text channel.
View Source​
Task ModifyAsync(Action<TextChannelProperties> func, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous modification operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Action<Discord.TextChannelProperties> | func | The delegate containing the properties to modify the channel with. |
Discord.RequestOptions | options | The options to be used when sending the request. |
CreateWebhookAsync(String, Stream, RequestOptions)​
Creates a webhook in this text channel.
View Source​
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​
Type | Name | Description |
---|---|---|
System.String | name | The name of the webhook. |
System.IO.Stream | avatar | The avatar of the webhook. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetWebhookAsync(UInt64, RequestOptions)​
Gets a webhook available in this text channel.
View Source​
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​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The identifier of the webhook. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetWebhooksAsync(RequestOptions)​
Gets the webhooks available in this text channel.
View Source​
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​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The 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​
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​
Type | Name | Description |
---|---|---|
System.String | name | The name of the thread. |
Discord.ThreadType | type |
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. |