Table of Contents

Class DiscordChannel

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

Represents a discord channel.

[JsonConverter(typeof(DiscordForumChannelJsonConverter))]
public class DiscordChannel : SnowflakeObject
Inheritance
object
DiscordChannel
Derived
Inherited Members
Extension Methods

Properties

Bitrate

Gets this channel's bitrate. This is applicable to voice channels only.

Children

Gets this channel's children. This applies only to channel categories.

Guild

Gets the guild to which this channel belongs.

GuildId

Gets ID of the guild to which this channel belongs.

IsCategory

Gets whether this channel is a channel category.

IsNSFW

Gets whether this channel is an NSFW channel.

IsPrivate

Gets whether this channel is a DM channel.

IsThread

Gets whether this channel is a thread.

LastMessageId

Gets the ID of the last message sent in this channel. This is applicable to text channels only.

LastPinTimestamp

Gets when the last pinned message was pinned.

Mention

Gets this channel's mention string.

Name

Gets the name of this channel.

Parent

Gets the category that contains this channel. For threads, gets the channel this thread was created in.

ParentId

Gets ID of the category that contains this channel. For threads, gets the ID of the channel this thread was created in.

PerUserRateLimit

Gets the slow mode delay configured for this channel.
All bots, as well as users with ManageChannels or ManageMessages permissions in the channel are exempt from slow mode.

PermissionOverwrites

Gets a collection of permission overwrites for this channel.

Position

Gets the position of this channel.

QualityMode

Gets this channel's video quality mode. This is applicable to voice channels only.

RtcRegion

Gets this channel's region override (if voice channel).

Threads

Gets this channel's threads. This applies only to text and news channels.

Topic

Gets the channel's topic. This is applicable to text channels only.

Type

Gets the type of this channel.

UserLimit

Gets this channel's user limit. This is applicable to voice channels only.

UserPermissions

Gets the permissions of the user who invoked the command in this channel.

Only sent on the resolved channels of interaction responses for application commands.

Users

Gets the list of members currently in the channel (if voice channel), or members who can see the channel (otherwise).

Methods

AddOverwriteAsync(DiscordMember, DiscordPermissions, DiscordPermissions, string?)

Adds a channel permission overwrite for specified member.

AddOverwriteAsync(DiscordRole, DiscordPermissions, DiscordPermissions, string?)

Adds a channel permission overwrite for specified role.

CloneAsync(string)

Clones this channel. This operation will create a channel with identical settings to this one. Note that this will not copy messages.

CreateGuildEventAsync(string, string, DiscordScheduledGuildEventPrivacyLevel, DateTimeOffset, DateTimeOffset?)

Creates an event bound to this channel.

CreateInviteAsync(int, int, bool, bool, string, DiscordInviteTargetType?, ulong?, ulong?)

Create a new invite object

CreateStageInstanceAsync(string, DiscordStagePrivacyLevel?, string)

Creates a stage instance in this stage channel.

CreateThreadAsync(DiscordMessage, string, DiscordAutoArchiveDuration, string)

Creates a new thread within this channel from the given message.

CreateThreadAsync(string, DiscordAutoArchiveDuration, DiscordChannelType, string)

Creates a new thread within this channel.

CreateWebhookAsync(string, Optional<Stream>, string)

Create a new webhook

CrosspostMessageAsync(DiscordMessage)

Publishes a message in a news channel to following channels

DeleteAsync(string)

Deletes a guild channel

DeleteMessageAsync(DiscordMessage, string)

Deletes a message

DeleteMessagesAsync(IAsyncEnumerable<DiscordMessage>, string?)

Deletes multiple messages if they are less than 14 days old. Does one api request per 100

DeleteMessagesAsync(IReadOnlyList<DiscordMessage>, string?)

Deletes multiple messages if they are less than 14 days old. If they are older, none of the messages will be deleted and you will receive a System.ArgumentException error.

DeleteOverwriteAsync(DiscordMember, string)

Deletes a channel permission overwrite for the specified member.

DeleteOverwriteAsync(DiscordRole, string)

Deletes a channel permission overwrite for the specified role.

DeleteStageInstanceAsync(string)

Deletes the stage instance in this stage channel.

Equals(DiscordChannel)

Checks whether this DiscordChannel is equal to another DiscordChannel.

Equals(object)

Checks whether this DiscordChannel is equal to another object.

FollowAsync(DiscordChannel)

Follows a news channel

GetHashCode()

Gets the hash code for this DiscordChannel.

GetInvitesAsync()

Returns a list of invite objects

GetMessageAsync(ulong, bool)

Returns a specific message

GetMessagesAfterAsync(ulong, int, CancellationToken)

Returns a list of messages after a certain message. This will execute one API request per 100 messages.

The amount of messages to fetch.Message to fetch after from.Cancels the enumeration before doing the next api request
GetMessagesAroundAsync(ulong, int, CancellationToken)

Returns a list of messages around a certain message. This will execute one API request per 100 messages.

The amount of messages to fetch.Message to fetch around from.Cancels the enumeration before doing the next api request
GetMessagesAsync(int, CancellationToken)

Returns a list of messages from the last message in the channel. This will execute one API request per 100 messages.

The amount of messages to fetch.Cancels the enumeration before doing the next api request
GetMessagesBeforeAsync(ulong, int, CancellationToken)

Returns a list of messages before a certain message. This will execute one API request per 100 messages.

The amount of messages to fetch.Message to fetch before from.Cancels the enumeration before doing the next api request
GetPinnedMessagesAsync()

Returns all pinned messages

GetStageInstanceAsync()

Gets the stage instance in this stage channel.

GetWebhooksAsync()

Returns a list of webhooks

ListJoinedPrivateArchivedThreadsAsync(DateTimeOffset?, int)

Gets the private and archived threads that the current member has joined in this channel.

ListPrivateArchivedThreadsAsync(DateTimeOffset?, int)

Gets the threads that are private and archived for this channel.

ListPublicArchivedThreadsAsync(DateTimeOffset?, int)

Gets the threads that are public and archived for this channel.

ModifyAsync(Action<ChannelEditModel>)

Modifies the current channel.

ModifyPositionAsync(int, string, bool?, ulong?)

Updates the channel position

ModifyStageInstanceAsync(Action<StageInstanceEditModel>)

Modifies the stage instance in this stage channel.

PermissionsFor(DiscordMember)

Calculates permissions for a given member.

PermissionsFor(DiscordRole)

Calculates permissions for a given role.

PlaceMemberAsync(DiscordMember)

Moves a member to this voice channel

SendMessageAsync(DiscordEmbed)

Sends a message to this channel.

SendMessageAsync(DiscordMessageBuilder)

Sends a message to this channel.

SendMessageAsync(Action<DiscordMessageBuilder>)

Sends a message to this channel.

SendMessageAsync(string)

Sends a message to this channel.

SendMessageAsync(string, DiscordEmbed)

Sends a message to this channel.

ToString()

Returns a string representation of this channel.

TriggerTypingAsync()

Post a typing indicator

UpdateCurrentUserVoiceStateAsync(bool?, DateTimeOffset?)

Updates the current user's suppress state in this channel, if stage channel.

Operators

operator ==(DiscordChannel, DiscordChannel)

Gets whether the two DiscordChannel objects are equal.

operator !=(DiscordChannel, DiscordChannel)

Gets whether the two DiscordChannel objects are not equal.