Class DiscordClient
A Discord API wrapper.
Inherited Members
Namespace: DSharpPlus
Assembly: cs.temp.dll.dll
Syntax
public sealed class DiscordClient : BaseDiscordClient
Constructors
DiscordClient(DiscordConfiguration)
Initializes a new instance of DiscordClient.
Declaration
public DiscordClient(DiscordConfiguration config)
Parameters
Type | Name | Description |
---|---|---|
DiscordConfiguration | config | Specifies configuration parameters. |
Properties
GatewayInfo
Gets the gateway session information for this client.
Declaration
public GatewayInfo GatewayInfo { get; }
Property Value
Type | Description |
---|---|
GatewayInfo |
GatewayUri
Gets the gateway URL.
Declaration
public Uri GatewayUri { get; }
Property Value
Type | Description |
---|---|
Uri |
GatewayVersion
Gets the gateway protocol version.
Declaration
public int GatewayVersion { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Guilds
Gets a dictionary of guilds that this client is in. The dictionary's key is the guild ID. Note that the guild objects in this dictionary will not be filled in if the specific guilds aren't available (the GuildAvailable or GuildDownloadCompleted events haven't been fired yet)
Declaration
public override IReadOnlyDictionary<ulong, DiscordGuild> Guilds { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<System.UInt64, DiscordGuild> |
Overrides
Intents
Gets the intents configured for this client.
Declaration
public DiscordIntents Intents { get; }
Property Value
Type | Description |
---|---|
DiscordIntents |
Ping
Gets the WS latency for this client.
Declaration
public int Ping { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Presences
Gets the collection of presences held by this client.
Declaration
public IReadOnlyDictionary<ulong, DiscordPresence> Presences { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<System.UInt64, DiscordPresence> |
PrivateChannels
Gets a dictionary of DM channels that have been cached by this client. The dictionary's key is the channel ID.
Declaration
public IReadOnlyDictionary<ulong, DiscordDmChannel> PrivateChannels { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<System.UInt64, DiscordDmChannel> |
ShardCount
Gets the total number of shards the bot is connected to.
Declaration
public int ShardCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ShardId
Gets the currently connected shard ID.
Declaration
public int ShardId { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
AddExtension(BaseExtension)
Registers an extension with this client.
Declaration
public void AddExtension(BaseExtension ext)
Parameters
Type | Name | Description |
---|---|---|
BaseExtension | ext | Extension to register. |
ConnectAsync(DiscordActivity, Nullable<UserStatus>, Nullable<DateTimeOffset>)
Connects to the gateway
Declaration
public Task ConnectAsync(DiscordActivity activity = null, UserStatus? status = default(UserStatus? ), DateTimeOffset? idlesince = default(DateTimeOffset? ))
Parameters
Type | Name | Description |
---|---|---|
DiscordActivity | activity | |
System.Nullable<UserStatus> | status | |
System.Nullable<DateTimeOffset> | idlesince |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when an invalid token was provided. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
CreateGuildAsync(String, String, Optional<Stream>, Nullable<VerificationLevel>, Nullable<DefaultMessageNotifications>)
Creates a guild. This requires the bot to be in less than 10 guilds total.
Declaration
public Task<DiscordGuild> CreateGuildAsync(string name, string region = null, Optional<Stream> icon = null, VerificationLevel? verificationLevel = default(VerificationLevel? ), DefaultMessageNotifications? defaultMessageNotifications = default(DefaultMessageNotifications? ))
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the guild. |
System.String | region | Voice region of the guild. |
Optional<Stream> | icon | Stream containing the icon for the guild. |
System.Nullable<VerificationLevel> | verificationLevel | Verification level for the guild. |
System.Nullable<DefaultMessageNotifications> | defaultMessageNotifications | Default message notification settings for the guild. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuild> | The created guild. |
Exceptions
Type | Condition |
---|---|
NotFoundException | Thrown when the channel does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
CreateGuildFromTemplateAsync(String, String, Optional<Stream>)
Creates a guild from a template. This requires the bot to be in less than 10 guilds total.
Declaration
public Task<DiscordGuild> CreateGuildFromTemplateAsync(string code, string name, Optional<Stream> icon = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | code | The template code. |
System.String | name | Name of the guild. |
Optional<Stream> | icon | Stream containing the icon for the guild. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuild> | The created guild. |
Exceptions
Type | Condition |
---|---|
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
DisconnectAsync()
Disconnects from the gateway
Declaration
public Task DisconnectAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Dispose()
Disposes your DiscordClient.
Declaration
public override void Dispose()
Overrides
Finalize()
Declaration
protected void Finalize()
GetChannelAsync(UInt64)
Gets a channel
Declaration
public Task<DiscordChannel> GetChannelAsync(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The id of the channel to get. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordChannel> |
Exceptions
Type | Condition |
---|---|
NotFoundException | Thrown when the channel does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
GetConnectionsAsync()
Gets a list of connections
Declaration
public Task<IReadOnlyList<DiscordConnection>> GetConnectionsAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordConnection>> |
Exceptions
Type | Condition |
---|---|
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
GetExtension<T>()
Retrieves a previously-registered extension from this client.
Declaration
public T GetExtension<T>()
where T : BaseExtension
Returns
Type | Description |
---|---|
T | The requested extension. |
Type Parameters
Name | Description |
---|---|
T | Type of extension to retrieve. |
GetGuildAsync(UInt64, Nullable<Boolean>)
Gets a guild.
Setting withCounts
to true will make a REST request.
Declaration
public Task<DiscordGuild> GetGuildAsync(ulong id, bool? withCounts = default(bool? ))
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The guild ID to search for. |
System.Nullable<System.Boolean> | withCounts | Whether to include approximate presence and member counts in the returned guild. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuild> | The requested Guild. |
Exceptions
Type | Condition |
---|---|
NotFoundException | Thrown when the guild does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
GetGuildPreviewAsync(UInt64)
Gets a guild preview
Declaration
public Task<DiscordGuildPreview> GetGuildPreviewAsync(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The guild ID. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuildPreview> |
Exceptions
Type | Condition |
---|---|
NotFoundException | Thrown when the guild does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
GetInviteByCodeAsync(String, Nullable<Boolean>)
Gets an invite.
Declaration
public Task<DiscordInvite> GetInviteByCodeAsync(string code, bool? withCounts = default(bool? ))
Parameters
Type | Name | Description |
---|---|---|
System.String | code | The invite code. |
System.Nullable<System.Boolean> | withCounts | Whether to include presence and total member counts in the returned invite. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordInvite> | The requested Invite. |
Exceptions
Type | Condition |
---|---|
NotFoundException | Thrown when the invite does not exists. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
GetTemplateAsync(String)
Gets a guild template by the code.
Declaration
public Task<DiscordGuildTemplate> GetTemplateAsync(string code)
Parameters
Type | Name | Description |
---|---|---|
System.String | code | The code of the template. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuildTemplate> | The guild template for the code. |
Exceptions
Type | Condition |
---|---|
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
GetUserAsync(UInt64)
Gets a user
Declaration
public Task<DiscordUser> GetUserAsync(ulong userId)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | userId | Id of the user |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordUser> |
Exceptions
Type | Condition |
---|---|
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
GetWebhookAsync(UInt64)
Gets a webhook
Declaration
public Task<DiscordWebhook> GetWebhookAsync(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordWebhook> |
Exceptions
Type | Condition |
---|---|
NotFoundException | Thrown when the webhook does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
GetWebhookWithTokenAsync(UInt64, String)
Gets a webhook
Declaration
public Task<DiscordWebhook> GetWebhookWithTokenAsync(ulong id, string token)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | |
System.String | token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordWebhook> |
Exceptions
Type | Condition |
---|---|
NotFoundException | Thrown when the webhook does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
ReconnectAsync(Boolean)
Declaration
public Task ReconnectAsync(bool startNewSession = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | startNewSession |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
SendMessageAsync(DiscordChannel, DiscordEmbed)
Sends a message
Declaration
public Task<DiscordMessage> SendMessageAsync(DiscordChannel channel, DiscordEmbed embed = null)
Parameters
Type | Name | Description |
---|---|---|
DiscordChannel | channel | Channel to send to. |
DiscordEmbed | embed | Embed to attach to the message. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> | The Discord Message that was sent. |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the SendMessages permission. |
NotFoundException | Thrown when the channel does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
SendMessageAsync(DiscordChannel, DiscordMessageBuilder)
Sends a message
Declaration
public Task<DiscordMessage> SendMessageAsync(DiscordChannel channel, DiscordMessageBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
DiscordChannel | channel | Channel to send to. |
DiscordMessageBuilder | builder | The Discord Mesage builder. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> | The Discord Message that was sent. |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the SendMessages permission if TTS is false and SendTtsMessages if TTS is true. |
NotFoundException | Thrown when the channel does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
SendMessageAsync(DiscordChannel, String)
Sends a message
Declaration
public Task<DiscordMessage> SendMessageAsync(DiscordChannel channel, string content = null)
Parameters
Type | Name | Description |
---|---|---|
DiscordChannel | channel | Channel to send to. |
System.String | content | Message content to send. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> | The Discord Message that was sent. |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the SendMessages permission. |
NotFoundException | Thrown when the channel does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
SendMessageAsync(DiscordChannel, String, DiscordEmbed)
Sends a message
Declaration
public Task<DiscordMessage> SendMessageAsync(DiscordChannel channel, string content = null, DiscordEmbed embed = null)
Parameters
Type | Name | Description |
---|---|---|
DiscordChannel | channel | Channel to send to. |
System.String | content | Message content to send. |
DiscordEmbed | embed | Embed to attach to the message. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> | The Discord Message that was sent. |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the SendMessages permission. |
NotFoundException | Thrown when the channel does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
UpdateCurrentUserAsync(String, Optional<Stream>)
Edits current user.
Declaration
public Task<DiscordUser> UpdateCurrentUserAsync(string username = null, Optional<Stream> avatar = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | New username. |
Optional<Stream> | avatar | New avatar. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordUser> |
Exceptions
Type | Condition |
---|---|
NotFoundException | Thrown when the user does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
UpdateStatusAsync(DiscordActivity, Nullable<UserStatus>, Nullable<DateTimeOffset>)
Updates current user's activity and status.
Declaration
public Task UpdateStatusAsync(DiscordActivity activity = null, UserStatus? userStatus = default(UserStatus? ), DateTimeOffset? idleSince = default(DateTimeOffset? ))
Parameters
Type | Name | Description |
---|---|---|
DiscordActivity | activity | Activity to set. |
System.Nullable<UserStatus> | userStatus | Status of the user. |
System.Nullable<DateTimeOffset> | idleSince | Since when is the client performing the specified activity. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Events
ChannelCreated
Declaration
public event AsyncEventHandler<DiscordClient, ChannelCreateEventArgs> ChannelCreated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, ChannelCreateEventArgs> |
ChannelDeleted
Declaration
public event AsyncEventHandler<DiscordClient, ChannelDeleteEventArgs> ChannelDeleted
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, ChannelDeleteEventArgs> |
ChannelPinsUpdated
Fired whenever a channel's pinned message list is updated. For this Event you need the Guilds intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, ChannelPinsUpdateEventArgs> ChannelPinsUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, ChannelPinsUpdateEventArgs> |
ChannelUpdated
Declaration
public event AsyncEventHandler<DiscordClient, ChannelUpdateEventArgs> ChannelUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, ChannelUpdateEventArgs> |
ClientErrored
Fired whenever an error occurs within an event handler.
Declaration
public event AsyncEventHandler<DiscordClient, ClientErrorEventArgs> ClientErrored
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, ClientErrorEventArgs> |
DmChannelDeleted
Fired when a dm channel is deleted For this Event you need the DirectMessages intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, DmChannelDeleteEventArgs> DmChannelDeleted
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, DmChannelDeleteEventArgs> |
GuildAvailable
Fired when a guild is becoming available. For this Event you need the Guilds intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, GuildCreateEventArgs> GuildAvailable
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildCreateEventArgs> |
GuildBanAdded
Declaration
public event AsyncEventHandler<DiscordClient, GuildBanAddEventArgs> GuildBanAdded
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildBanAddEventArgs> |
GuildBanRemoved
Fired when a guild ban gets removed For this Event you need the GuildBans intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, GuildBanRemoveEventArgs> GuildBanRemoved
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildBanRemoveEventArgs> |
GuildCreated
Fired when the user joins a new guild. For this Event you need the Guilds intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, GuildCreateEventArgs> GuildCreated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildCreateEventArgs> |
Equivalent names
GuildJoined, JoinedGuild
GuildDeleted
Fired when the user leaves or is removed from a guild. For this Event you need the Guilds intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, GuildDeleteEventArgs> GuildDeleted
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildDeleteEventArgs> |
GuildDownloadCompleted
Fired when all guilds finish streaming from Discord.
Declaration
public event AsyncEventHandler<DiscordClient, GuildDownloadCompletedEventArgs> GuildDownloadCompleted
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildDownloadCompletedEventArgs> |
GuildEmojisUpdated
Fired when a guilds emojis get updated For this Event you need the GuildEmojis intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, GuildEmojisUpdateEventArgs> GuildEmojisUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildEmojisUpdateEventArgs> |
GuildIntegrationsUpdated
Fired when a guild integration is updated.
Declaration
public event AsyncEventHandler<DiscordClient, GuildIntegrationsUpdateEventArgs> GuildIntegrationsUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildIntegrationsUpdateEventArgs> |
GuildMemberAdded
Fired when a new user joins a guild. For this Event you need the GuildMembers intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, GuildMemberAddEventArgs> GuildMemberAdded
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildMemberAddEventArgs> |
GuildMemberRemoved
Fired when a user is removed from a guild (leave/kick/ban). For this Event you need the GuildMembers intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, GuildMemberRemoveEventArgs> GuildMemberRemoved
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildMemberRemoveEventArgs> |
GuildMembersChunked
Fired in response to Gateway Request Guild Members.
Declaration
public event AsyncEventHandler<DiscordClient, GuildMembersChunkEventArgs> GuildMembersChunked
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildMembersChunkEventArgs> |
GuildMemberUpdated
Fired when a guild member is updated. For this Event you need the GuildMembers intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, GuildMemberUpdateEventArgs> GuildMemberUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildMemberUpdateEventArgs> |
GuildRoleCreated
Declaration
public event AsyncEventHandler<DiscordClient, GuildRoleCreateEventArgs> GuildRoleCreated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildRoleCreateEventArgs> |
GuildRoleDeleted
Declaration
public event AsyncEventHandler<DiscordClient, GuildRoleDeleteEventArgs> GuildRoleDeleted
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildRoleDeleteEventArgs> |
GuildRoleUpdated
Declaration
public event AsyncEventHandler<DiscordClient, GuildRoleUpdateEventArgs> GuildRoleUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildRoleUpdateEventArgs> |
GuildUnavailable
Fired when a guild becomes unavailable.
Declaration
public event AsyncEventHandler<DiscordClient, GuildDeleteEventArgs> GuildUnavailable
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildDeleteEventArgs> |
GuildUpdated
Declaration
public event AsyncEventHandler<DiscordClient, GuildUpdateEventArgs> GuildUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, GuildUpdateEventArgs> |
Heartbeated
Fired on received heartbeat ACK.
Declaration
public event AsyncEventHandler<DiscordClient, HeartbeatEventArgs> Heartbeated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, HeartbeatEventArgs> |
InviteCreated
Fired when an invite is created. For this Event you need the GuildInvites intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, InviteCreateEventArgs> InviteCreated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, InviteCreateEventArgs> |
InviteDeleted
Fired when an invite is deleted. For this Event you need the GuildInvites intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, InviteDeleteEventArgs> InviteDeleted
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, InviteDeleteEventArgs> |
MessageAcknowledged
Fired when message is acknowledged by the user. For this Event you need the GuildMessages intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, MessageAcknowledgeEventArgs> MessageAcknowledged
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, MessageAcknowledgeEventArgs> |
MessageCreated
Fired when a message is created. For this Event you need the GuildMessages intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, MessageCreateEventArgs> MessageCreated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, MessageCreateEventArgs> |
MessageDeleted
Fired when a message is deleted. For this Event you need the GuildMessages intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, MessageDeleteEventArgs> MessageDeleted
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, MessageDeleteEventArgs> |
MessageReactionAdded
Fired when a reaction gets added to a message. For this Event you need the GuildMessageReactions intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, MessageReactionAddEventArgs> MessageReactionAdded
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, MessageReactionAddEventArgs> |
MessageReactionRemoved
Fired when a reaction gets removed from a message. For this Event you need the GuildMessageReactions intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, MessageReactionRemoveEventArgs> MessageReactionRemoved
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, MessageReactionRemoveEventArgs> |
MessageReactionRemovedEmoji
Fired when all reactions of a specific reaction are removed from a message. For this Event you need the GuildMessageReactions intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, MessageReactionRemoveEmojiEventArgs> MessageReactionRemovedEmoji
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, MessageReactionRemoveEmojiEventArgs> |
MessageReactionsCleared
Fired when all reactions get removed from a message. For this Event you need the GuildMessageReactions intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, MessageReactionsClearEventArgs> MessageReactionsCleared
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, MessageReactionsClearEventArgs> |
MessagesBulkDeleted
Fired when multiple messages are deleted at once. For this Event you need the GuildMessages intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, MessageBulkDeleteEventArgs> MessagesBulkDeleted
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, MessageBulkDeleteEventArgs> |
MessageUpdated
Fired when a message is updated. For this Event you need the GuildMessages intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, MessageUpdateEventArgs> MessageUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, MessageUpdateEventArgs> |
PresenceUpdated
Fired when a presence has been updated. For this Event you need the GuildPresences intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, PresenceUpdateEventArgs> PresenceUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, PresenceUpdateEventArgs> |
Ready
Fired when the client enters ready state.
Declaration
public event AsyncEventHandler<DiscordClient, ReadyEventArgs> Ready
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, ReadyEventArgs> |
Resumed
Fired whenever a session is resumed.
Declaration
public event AsyncEventHandler<DiscordClient, ReadyEventArgs> Resumed
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, ReadyEventArgs> |
SocketClosed
Fired whenever WebSocket connection is terminated.
Declaration
public event AsyncEventHandler<DiscordClient, SocketCloseEventArgs> SocketClosed
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, SocketCloseEventArgs> |
SocketErrored
Fired whenever a WebSocket error occurs within the client.
Declaration
public event AsyncEventHandler<DiscordClient, SocketErrorEventArgs> SocketErrored
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, SocketErrorEventArgs> |
SocketOpened
Fired whenever WebSocket connection is established.
Declaration
public event AsyncEventHandler<DiscordClient, SocketEventArgs> SocketOpened
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, SocketEventArgs> |
TypingStarted
Fired when a user starts typing in a channel.
Declaration
public event AsyncEventHandler<DiscordClient, TypingStartEventArgs> TypingStarted
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, TypingStartEventArgs> |
UnknownEvent
Fired when an unknown event gets received.
Declaration
public event AsyncEventHandler<DiscordClient, UnknownEventArgs> UnknownEvent
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, UnknownEventArgs> |
UserSettingsUpdated
Fired when the current user updates their settings. For this Event you need the GuildPresences intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, UserSettingsUpdateEventArgs> UserSettingsUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, UserSettingsUpdateEventArgs> |
UserUpdated
Fired when properties about the current user change.
Declaration
public event AsyncEventHandler<DiscordClient, UserUpdateEventArgs> UserUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, UserUpdateEventArgs> |
Remarks
NB: This event only applies for changes to the current user, the client that is connected to Discord. For this Event you need the GuildPresences intent specified in Intents
VoiceServerUpdated
Fired when a guild's voice server is updated. For this Event you need the GuildVoiceStates intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, VoiceServerUpdateEventArgs> VoiceServerUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, VoiceServerUpdateEventArgs> |
VoiceStateUpdated
Fired when someone joins/leaves/moves voice channels. For this Event you need the GuildVoiceStates intent specified in Intents
Declaration
public event AsyncEventHandler<DiscordClient, VoiceStateUpdateEventArgs> VoiceStateUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, VoiceStateUpdateEventArgs> |
WebhooksUpdated
Fired whenever webhooks update.
Declaration
public event AsyncEventHandler<DiscordClient, WebhooksUpdateEventArgs> WebhooksUpdated
Event Type
Type | Description |
---|---|
AsyncEventHandler<DiscordClient, WebhooksUpdateEventArgs> |