Table of Contents

Class EventHandlingBuilder

Namespace
DSharpPlus
Assembly
DSharpPlus.dll

Provides an API for configuring delegate-based event handlers for your application.

public sealed class EventHandlingBuilder
Inheritance
EventHandlingBuilder

Properties

Services

The underlying service collection for this application.

Methods

AddEventHandlers(IReadOnlyList<Type>, ServiceLifetime)

Registers all event handlers implemented on the provided types.

AddEventHandlers<T>(ServiceLifetime)

Registers all event handlers implemented on the provided type.

HandleApplicationCommandPermissionsUpdated(Func<DiscordClient, ApplicationCommandPermissionsUpdatedEventArgs, Task>)

Fired when the permissions for an application command are updated.

HandleAutoModerationRuleCreated(Func<DiscordClient, AutoModerationRuleCreatedEventArgs, Task>)

Fired when a new auto-moderation rule is created.

HandleAutoModerationRuleDeleted(Func<DiscordClient, AutoModerationRuleDeletedEventArgs, Task>)

Fired when an auto-moderation rule is deleted.

HandleAutoModerationRuleExecuted(Func<DiscordClient, AutoModerationRuleExecutedEventArgs, Task>)

Fired when an auto-moderation is executed.

HandleAutoModerationRuleUpdated(Func<DiscordClient, AutoModerationRuleUpdatedEventArgs, Task>)

Fired when an auto-moderation rule is updated.

HandleChannelCreated(Func<DiscordClient, ChannelCreatedEventArgs, Task>)

Fired when a new channel is created. For this event to fire you need the Guilds intent.

HandleChannelDeleted(Func<DiscordClient, ChannelDeletedEventArgs, Task>)

Fired when a channel is deleted. For this event to fire you need the Guilds intent.

HandleChannelPinsUpdated(Func<DiscordClient, ChannelPinsUpdatedEventArgs, Task>)

Fired whenever a channels pinned message list is updated. For this event to fire you need the Guilds intent.

HandleChannelUpdated(Func<DiscordClient, ChannelUpdatedEventArgs, Task>)

Fired when a channel is updated. For this event to fire you need the Guilds intent.

HandleComponentInteractionCreated(Func<DiscordClient, ComponentInteractionCreatedEventArgs, Task>)

Fired when a component is interacted with.

HandleContextMenuInteractionCreated(Func<DiscordClient, ContextMenuInteractionCreatedEventArgs, Task>)

Fired when a user uses a context menu.

HandleDmChannelDeleted(Func<DiscordClient, DmChannelDeletedEventArgs, Task>)

Fired when a DM channel is deleted. For this event to fire you need the DirectMessages intent.

HandleEntitlementCreated(Func<DiscordClient, EntitlementCreatedEventArgs, Task>)

Fired when an entitlement was created.

HandleEntitlementDeleted(Func<DiscordClient, EntitlementDeletedEventArgs, Task>)

Fired when an entitlement was deleted.

HandleEntitlementUpdated(Func<DiscordClient, EntitlementUpdatedEventArgs, Task>)

Fired when an entitlement was updated.

HandleGuildAuditLogCreated(Func<DiscordClient, GuildAuditLogCreatedEventArgs, Task>)

Fired when a audit log entry is created.

HandleGuildAvailable(Func<DiscordClient, GuildAvailableEventArgs, Task>)

Fired when a guild is becoming available. For this event to fire you need the Guilds intent.

HandleGuildBanAdded(Func<DiscordClient, GuildBanAddedEventArgs, Task>)

Fired when a guild ban gets added. For this event to fire you need the GuildModeration intent.

HandleGuildBanRemoved(Func<DiscordClient, GuildBanRemovedEventArgs, Task>)

Fired when a guild ban gets removed. For this event to fire you need the GuildModeration intent.

HandleGuildCreated(Func<DiscordClient, GuildCreatedEventArgs, Task>)

Fired when the user joins a new guild. For this event to fire you need the Guilds intent.

HandleGuildDeleted(Func<DiscordClient, GuildDeletedEventArgs, Task>)

Fired when the user leaves or is removed from a guild. For this event to fire you need the Guilds intent.

HandleGuildDownloadCompleted(Func<DiscordClient, GuildDownloadCompletedEventArgs, Task>)

Fired when all guilds finish streaming from Discord upon initial connection. For this event to fire you need the Guilds intent.

HandleGuildEmojisUpdated(Func<DiscordClient, GuildEmojisUpdatedEventArgs, Task>)

Fired when a guilds emojis get updated. For this event to fire you need the GuildEmojisAndStickers intent.

HandleGuildIntegrationsUpdated(Func<DiscordClient, GuildIntegrationsUpdatedEventArgs, Task>)

Fired when a guild integration is updated.

HandleGuildMemberAdded(Func<DiscordClient, GuildMemberAddedEventArgs, Task>)

Fired when a new user joins a guild. For this event to fire you need the GuildMembers intent.

HandleGuildMemberRemoved(Func<DiscordClient, GuildMemberRemovedEventArgs, Task>)

Fired when a user is removed from a guild, by leaving, a kick or a ban. For this event to fire you need the GuildMembers intent.

HandleGuildMemberUpdated(Func<DiscordClient, GuildMemberUpdatedEventArgs, Task>)

Fired when a guild member is updated. For this event to fire you need the GuildMembers intent.

HandleGuildMembersChunked(Func<DiscordClient, GuildMembersChunkedEventArgs, Task>)

Fired in response to requesting guild members over the gateway.

HandleGuildRoleCreated(Func<DiscordClient, GuildRoleCreatedEventArgs, Task>)

Fired when a guild role is created. For this event to fire you need the Guilds intent.

HandleGuildRoleDeleted(Func<DiscordClient, GuildRoleDeletedEventArgs, Task>)

Fired when a guild role is deleted. For this event to fire you need the Guilds intent.

HandleGuildRoleUpdated(Func<DiscordClient, GuildRoleUpdatedEventArgs, Task>)

Fired when a guild role is updated. For this event to fire you need the Guilds intent.

HandleGuildStickersUpdated(Func<DiscordClient, GuildStickersUpdatedEventArgs, Task>)

Fired when a guilds stickers get updated. For this event to fire you need the GuildEmojisAndStickers intent.

HandleGuildUnavailable(Func<DiscordClient, GuildUnavailableEventArgs, Task>)

Fired when a guild becomes unavailable. For this event to fire you need the Guilds intent.

HandleGuildUpdated(Func<DiscordClient, GuildUpdatedEventArgs, Task>)

Fired when a guild is updated. For this event to fire you need the Guilds intent.

HandleIntegrationCreated(Func<DiscordClient, IntegrationCreatedEventArgs, Task>)

Fired when an integration is created.

HandleIntegrationDeleted(Func<DiscordClient, IntegrationDeletedEventArgs, Task>)

Fired when an integration is deleted.

HandleIntegrationUpdated(Func<DiscordClient, IntegrationUpdatedEventArgs, Task>)

Fired when an integration is updated.

HandleInteractionCreated(Func<DiscordClient, InteractionCreatedEventArgs, Task>)

Fired when any interaction is invoked.

HandleInviteCreated(Func<DiscordClient, InviteCreatedEventArgs, Task>)

Fired when an invite is created. For this event to fire you need the GuildInvites intent.

HandleInviteDeleted(Func<DiscordClient, InviteDeletedEventArgs, Task>)

Fired when an invite is deleted. For this event to fire you need the GuildInvites intent.

HandleMessageCreated(Func<DiscordClient, MessageCreatedEventArgs, Task>)

Fired when a message is created. For this event to fire you need the GuildMessages or DirectMessages intent.

HandleMessageDeleted(Func<DiscordClient, MessageDeletedEventArgs, Task>)

Fired when a message is deleted. For this event to fire you need the GuildMessages or DirectMessages intent.

HandleMessagePollVoted(Func<DiscordClient, MessagePollVotedEventArgs, Task>)

Fired when a vote was cast on a poll.

HandleMessageReactionAdded(Func<DiscordClient, MessageReactionAddedEventArgs, Task>)

Fired when a reaction gets added to a message. For this event to fire you need the GuildMessageReactions intent.

HandleMessageReactionRemoved(Func<DiscordClient, MessageReactionRemovedEventArgs, Task>)

Fired when a reaction gets removed from a message. For this event to fire you need the GuildMessageReactions intent.

HandleMessageReactionRemovedEmoji(Func<DiscordClient, MessageReactionRemovedEmojiEventArgs, Task>)

Fired when all reactions of a specific emoji are removed from a message. For this event to fire you need the GuildMessageReactions intent.

HandleMessageReactionsCleared(Func<DiscordClient, MessageReactionsClearedEventArgs, Task>)

Fired when all reactions get removed from a message. For this event to fire you need the GuildMessageReactions intent.

HandleMessageUpdated(Func<DiscordClient, MessageUpdatedEventArgs, Task>)

Fired when a message is updated. For this event to fire you need the GuildMessages or DirectMessages intent.

HandleMessagesBulkDeleted(Func<DiscordClient, MessagesBulkDeletedEventArgs, Task>)

Fired when multiple messages are deleted at once. For this event to fire you need the GuildMessages or DirectMessages intent.

HandleModalSubmitted(Func<DiscordClient, ModalSubmittedEventArgs, Task>)

Fired when a modal is submitted. If a modal is closed, this event is not fired.

HandlePresenceUpdated(Func<DiscordClient, PresenceUpdatedEventArgs, Task>)

Fired when a user presence has been updated. For this event to fire you need the GuildPresences intent.

HandleScheduledGuildEventCompleted(Func<DiscordClient, ScheduledGuildEventCompletedEventArgs, Task>)

Fired when a scheduled event is completed.

HandleScheduledGuildEventCreated(Func<DiscordClient, ScheduledGuildEventCreatedEventArgs, Task>)

Fired when a scheduled event is created.

HandleScheduledGuildEventDeleted(Func<DiscordClient, ScheduledGuildEventDeletedEventArgs, Task>)

Fired when a scheduled event is deleted.

HandleScheduledGuildEventUpdated(Func<DiscordClient, ScheduledGuildEventUpdatedEventArgs, Task>)

Fired when a scheduled event is updated.

HandleScheduledGuildEventUserAdded(Func<DiscordClient, ScheduledGuildEventUserAddedEventArgs, Task>)

Fired when an user is registered to a scheduled event.

HandleScheduledGuildEventUserRemoved(Func<DiscordClient, ScheduledGuildEventUserRemovedEventArgs, Task>)

Fired when an user removes themselves from a scheduled event.

HandleSessionCreated(Func<DiscordClient, SessionCreatedEventArgs, Task>)

Fired when this client has successfully completed its handshake with the websocket gateway.

HandleSessionResumed(Func<DiscordClient, SessionResumedEventArgs, Task>)

Fired whenever a session is resumed.

HandleSocketClosed(Func<DiscordClient, SocketClosedEventArgs, Task>)

Fired whenever the underlying websocket connection is terminated.

HandleSocketOpened(Func<DiscordClient, SocketOpenedEventArgs, Task>)

Fired whenever the underlying websocket connection is established.

HandleStageInstanceCreated(Func<DiscordClient, StageInstanceCreatedEventArgs, Task>)

Fired when a stage instance is created.

HandleStageInstanceDeleted(Func<DiscordClient, StageInstanceDeletedEventArgs, Task>)

Fired when a stage instance is deleted.

HandleStageInstanceUpdated(Func<DiscordClient, StageInstanceUpdatedEventArgs, Task>)

Fired when a stage instance is updated.

HandleThreadCreated(Func<DiscordClient, ThreadCreatedEventArgs, Task>)

Fired when a thread is created. For this event to fire you need the Guilds intent.

HandleThreadDeleted(Func<DiscordClient, ThreadDeletedEventArgs, Task>)

Fired when a thread is deleted. For this event to fire you need the Guilds intent.

HandleThreadListSynced(Func<DiscordClient, ThreadListSyncedEventArgs, Task>)

Fired when the current member gains access to channels that contain threads. For this event to fire you need the Guilds intent.

HandleThreadMemberUpdated(Func<DiscordClient, ThreadMemberUpdatedEventArgs, Task>)

Fired when the thread member for the current user is updated. For this event to fire you need the Guilds intent.

HandleThreadMembersUpdated(Func<DiscordClient, ThreadMembersUpdatedEventArgs, Task>)

Fired when the thread members are updated. For this event to fire you need the GuildMembers or Guilds intent.

HandleThreadUpdated(Func<DiscordClient, ThreadUpdatedEventArgs, Task>)

Fired when a thread is updated. For this event to fire you need the Guilds intent.

HandleTypingStarted(Func<DiscordClient, TypingStartedEventArgs, Task>)

Fired when a user starts typing in a channel.

HandleUnknownEvent(Func<DiscordClient, UnknownEventArgs, Task>)

Fired when an unknown event gets received.

HandleUserSettingsUpdated(Func<DiscordClient, UserSettingsUpdatedEventArgs, Task>)

Fired when the current user updates their settings. For this event to fire you need the GuildPresences intent.

HandleUserUpdated(Func<DiscordClient, UserUpdatedEventArgs, Task>)

Fired when properties about the current user change.

HandleVoiceServerUpdated(Func<DiscordClient, VoiceServerUpdatedEventArgs, Task>)

Fired when a guild's voice server is updated. For this event to fire you need the GuildVoiceStates intent.

HandleVoiceStateUpdated(Func<DiscordClient, VoiceStateUpdatedEventArgs, Task>)

Fired when someone joins, leaves or moves voice channels. For this event to fire you need the GuildVoiceStates intent.

HandleWebhooksUpdated(Func<DiscordClient, WebhooksUpdatedEventArgs, Task>)

Fired whenever webhooks update.

HandleZombied(Func<DiscordClient, ZombiedEventArgs, Task>)

Fired when too many consecutive heartbeats fail and the library considers the connection zombied.