TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/disgoorg/disgo/llms.txt
Use this file to discover all available pages before exploring further.
events package provides a comprehensive event system for handling Discord gateway events. All events extend from GenericEvent and provide type-safe access to Discord data.
Core event types
GenericEvent
The base event structure that all other events extend from.The bot client instance that dispatched this event
The sequence number of the gateway event
The shard ID the event was dispatched from
Methods
Returns the bot.Client instance that dispatched the event
Returns the sequence number of the gateway event
Returns the shard ID the event was dispatched from
ListenerAdapter
Provides a convenient way to selectively handle events by implementing only the handlers you need.Guild events
GuildUpdate
Called when a guild is updated.The updated guild
The old cached guild before the update
GuildJoin
Called when the bot joins a guild.GuildLeave
Called when the bot leaves a guild.GuildsReady
Called when all guilds are loaded after logging in.GuildBan
Called when a user is banned from a guild.GuildUnban
Called when a user is unbanned from a guild.Message events
GenericMessage
The base message event structure.Methods
Returns the channel where the message was sent
Returns the guild where the message was sent, or nil if it was sent in DMs
MessageCreate
Called when a message is received.MessageUpdate
Called when a message is updated.MessageDelete
Called when a message is deleted.Interaction events
InteractionCreate
Called when a new interaction is created (commands, components, autocomplete, modals).The interaction data
Function to respond to the interaction
Methods
Returns the guild where the interaction happened, if it happened in a guild
ApplicationCommandInteractionCreate
Called when an application command is invoked.Response methods
Acknowledges the interaction with a 202 Accepted response
Responds to the interaction with a new message
Responds with a “bot is thinking…” message that should be edited later
Responds to the interaction with a modal
Responds by launching an activity associated with the app
ComponentInteractionCreate
Called when a component (button, select menu) is interacted with.Response methods
Responds to the interaction with a new message
Responds by updating the message the component is from
Responds with nothing, acknowledging the interaction
Responds to the interaction with a modal
AutocompleteInteractionCreate
Called when autocomplete options are requested.Response methods
Responds with autocomplete choices
ModalSubmitInteractionCreate
Called when a modal is submitted.Response methods
Responds to the modal submission with a new message
Responds by updating the original message
Defers the response with a loading state
Event categories
The events package includes events for:- Gateway events: Ready, Resumed, HeartbeatAck, GatewayRateLimited
- Guild events: GuildUpdate, GuildJoin, GuildLeave, GuildAvailable, GuildUnavailable
- Channel events: GuildChannelCreate, GuildChannelUpdate, GuildChannelDelete, ThreadCreate, ThreadUpdate
- Member events: GuildMemberJoin, GuildMemberUpdate, GuildMemberLeave
- Role events: RoleCreate, RoleUpdate, RoleDelete
- Message events: MessageCreate, MessageUpdate, MessageDelete
- Reaction events: MessageReactionAdd, MessageReactionRemove
- Voice events: VoiceServerUpdate, GuildVoiceStateUpdate, GuildVoiceJoin, GuildVoiceMove, GuildVoiceLeave
- Interaction events: InteractionCreate, ApplicationCommandInteractionCreate, ComponentInteractionCreate
- Presence events: PresenceUpdate, UserActivityStart, UserActivityUpdate
- Scheduled events: GuildScheduledEventCreate, GuildScheduledEventUpdate, GuildScheduledEventDelete
- Auto-moderation events: AutoModerationRuleCreate, AutoModerationActionExecution
- Emoji/Sticker events: EmojiCreate, EmojiUpdate, StickerCreate, StickerUpdate
- Webhook events: WebhooksUpdate
- Integration events: IntegrationCreate, IntegrationUpdate, IntegrationDelete
- Entitlement events: EntitlementCreate, EntitlementUpdate, EntitlementDelete