Class DiscordShardedClient
- Namespace
- DSharpPlus
- Assembly
- DSharpPlus.dll
A Discord client that shards automatically.
public sealed class DiscordShardedClient
- Inheritance
-
DiscordShardedClient
- Extension Methods
Constructors
- DiscordShardedClient(DiscordConfiguration)
Initializes new auto-sharding Discord client.
Properties
- CurrentApplication
Gets the current application.
- CurrentUser
Gets the current user.
- GatewayInfo
Gets the gateway info for the client's session.
- Logger
Gets the logger for this client.
- ShardClients
Gets all client shards.
- VoiceRegions
Gets the list of available voice regions. Note that this property will not contain VIP voice regions.
Methods
- GetShard(DiscordGuild)
Gets a shard from a guild.
If automatically sharding, this will use the GetShardId(ulong, int) method. Otherwise if manually sharding, it will instead iterate through each shard's guild caches.
- GetShard(ulong)
Gets a shard from a guild ID.
If automatically sharding, this will use the GetShardId(ulong, int) method. Otherwise if manually sharding, it will instead iterate through each shard's guild caches.
- StartAsync()
Initializes and connects all shards.
- StopAsync()
Disconnects and disposes of all shards.
- UpdateStatusAsync(DiscordActivity, DiscordUserStatus?, DateTimeOffset?)
Updates playing statuses on all shards.
Events
- AutoModerationRuleCreated
Fired when a new auto-moderation rule is created.
- AutoModerationRuleDeleted
Fired when an auto-moderation rule is deleted.
- AutoModerationRuleExecuted
Fired when an auto-moderation is executed.
- AutoModerationRuleUpdated
Fired when an auto-moderation rule is updated.
- ChannelCreated
Fired when a new channel is created. For this Event you need the Guilds intent specified in Intents
- ChannelDeleted
Fired when a channel is deleted For this Event you need the Guilds intent specified in Intents
- ChannelPinsUpdated
Fired whenever a channel's pinned message list is updated. For this Event you need the Guilds intent specified in Intents
- ChannelUpdated
Fired when a channel is updated. For this Event you need the Guilds intent specified in Intents
- ClientErrored
Fired whenever an error occurs within an event handler.
- ComponentInteractionCreated
Fired when a component is invoked.
- ContextMenuInteractionCreated
Fired when a user uses a context menu.
- DmChannelDeleted
Fired when a dm channel is deleted For this Event you need the DirectMessages intent specified in Intents
- GuildAuditLogCreated
Fired when a audit log entry is created.
- GuildAvailable
Fired when a guild is becoming available. For this Event you need the Guilds intent specified in Intents
- GuildBanAdded
Fired when a guild ban gets added For this Event you need the GuildModeration intent specified in Intents
- GuildBanRemoved
Fired when a guild ban gets removed For this Event you need the GuildModeration intent specified in Intents
- GuildCreated
Fired when the user joins a new guild. For this Event you need the Guilds intent specified in Intents
- GuildDeleted
Fired when the user leaves or is removed from a guild. For this Event you need the Guilds intent specified in Intents
- GuildDownloadCompleted
Fired when all guilds finish streaming from Discord.
- GuildEmojisUpdated
Fired when a guilds emojis get updated For this Event you need the GuildEmojisAndStickers intent specified in Intents
- GuildIntegrationsUpdated
Fired when a guild integration is updated.
- GuildMemberAdded
Fired when a new user joins a guild. For this Event you need the GuildMembers intent specified in Intents
- GuildMemberRemoved
Fired when a user is removed from a guild (leave/kick/ban). For this Event you need the GuildMembers intent specified in Intents
- GuildMemberUpdated
Fired when a guild member is updated. For this Event you need the GuildMembers intent specified in Intents
- GuildMembersChunked
Fired in response to Gateway Request Guild Members.
- GuildRoleCreated
Fired when a guild role is created. For this Event you need the Guilds intent specified in Intents
- GuildRoleDeleted
Fired when a guild role is updated. For this Event you need the Guilds intent specified in Intents
- GuildRoleUpdated
Fired when a guild role is updated. For this Event you need the Guilds intent specified in Intents
- GuildUnavailable
Fired when a guild becomes unavailable.
- GuildUpdated
Fired when a guild is updated. For this Event you need the Guilds intent specified in Intents
- Heartbeated
Fired on received heartbeat ACK.
- IntegrationCreated
Fired when an integration is created.
- IntegrationDeleted
Fired when an integration is deleted.
- IntegrationUpdated
Fired when an integration is updated.
- InteractionCreated
Fired when an interaction is invoked.
- InviteCreated
Fired when an invite is created. For this Event you need the GuildInvites intent specified in Intents
- InviteDeleted
Fired when an invite is deleted. For this Event you need the GuildInvites intent specified in Intents
- MessageCreated
Fired when a message is created. For this Event you need the GuildMessages intent specified in Intents
- MessageDeleted
Fired when a message is deleted. For this Event you need the GuildMessages intent specified in Intents
- MessageReactionAdded
Fired when a reaction gets added to a message. For this Event you need the GuildMessageReactions intent specified in Intents
- MessageReactionRemoved
Fired when a reaction gets removed from a message. For this Event you need the GuildMessageReactions intent specified in Intents
- 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
- MessageReactionsCleared
Fired when all reactions get removed from a message. For this Event you need the GuildMessageReactions intent specified in Intents
- MessageUpdated
Fired when a message is updated. For this Event you need the GuildMessages intent specified in Intents
- MessagesBulkDeleted
Fired when multiple messages are deleted at once. For this Event you need the GuildMessages intent specified in Intents
- ModalSubmitted
Fired when a modal is submitted. If a modal is closed, this event is not fired.
- PresenceUpdated
Fired when a presence has been updated. For this Event you need the GuildPresences intent specified in Intents
- SessionCreated
Fired when this client has successfully completed its handshake with the websocket gateway.
- SessionResumed
Fired whenever a session is resumed.
- SocketClosed
Fired whenever WebSocket connection is terminated.
- SocketErrored
Fired whenever a WebSocket error occurs within the client.
- SocketOpened
Fired whenever WebSocket connection is established.
- StageInstanceCreated
Fired when a stage instance is created.
- StageInstanceDeleted
Fired when a stage instance is deleted.
- StageInstanceUpdated
Fired when a stage instance is updated.
- ThreadCreated
Fired when a thread is created. For this Event you need the Guilds intent specified in Intents
- ThreadDeleted
Fired when a thread is deleted. For this Event you need the Guilds intent specified in Intents
- ThreadListSynced
Fired when the current member gains access to a channel(s) that has threads. For this Event you need the Guilds intent specified in Intents
- ThreadMemberUpdated
Fired when the thread member for the current user is updated. For this Event you need the Guilds intent specified in Intents
- ThreadMembersUpdated
Fired when the thread members are updated. For this Event you need the GuildMembers or Guilds intent specified in Intents
- ThreadUpdated
Fired when a thread is updated. For this Event you need the Guilds intent specified in Intents
- TypingStarted
Fired when a user starts typing in a channel.
- UnknownEvent
Fired when an unknown event gets received.
- UserSettingsUpdated
Fired when the current user updates their settings. For this Event you need the GuildPresences intent specified in Intents
- UserUpdated
Fired when properties about the current user change.
- VoiceServerUpdated
Fired when a guild's voice server is updated. For this Event you need the GuildVoiceStates intent specified in Intents
- VoiceStateUpdated
Fired when someone joins/leaves/moves voice channels. For this Event you need the GuildVoiceStates intent specified in Intents
- WebhooksUpdated
Fired whenever webhooks update.
- Zombied
Fired on heartbeat attempt cancellation due to too many failed heartbeats.