#[non_exhaustive]pub enum FullEvent {
Show 74 variants
CommandPermissionsUpdate {
permission: CommandPermissions,
},
AutoModRuleCreate {
rule: Rule,
},
AutoModRuleUpdate {
rule: Rule,
},
AutoModRuleDelete {
rule: Rule,
},
AutoModActionExecution {
execution: ActionExecution,
},
CacheReady {
guilds: Vec<GuildId>,
},
ShardsReady {
total_shards: u32,
},
ChannelCreate {
channel: GuildChannel,
},
CategoryCreate {
category: GuildChannel,
},
CategoryDelete {
category: GuildChannel,
},
ChannelDelete {
channel: GuildChannel,
messages: Option<Vec<Message>>,
},
ChannelPinsUpdate {
pin: ChannelPinsUpdateEvent,
},
ChannelUpdate {
old: Option<GuildChannel>,
new: GuildChannel,
},
GuildAuditLogEntryCreate {
entry: AuditLogEntry,
guild_id: GuildId,
},
GuildBanAddition {
guild_id: GuildId,
banned_user: User,
},
GuildBanRemoval {
guild_id: GuildId,
unbanned_user: User,
},
GuildCreate {
guild: Guild,
is_new: Option<bool>,
},
GuildDelete {
incomplete: UnavailableGuild,
full: Option<Guild>,
},
GuildEmojisUpdate {
guild_id: GuildId,
current_state: HashMap<EmojiId, Emoji>,
},
GuildIntegrationsUpdate {
guild_id: GuildId,
},
GuildMemberAddition {
new_member: Member,
},
GuildMemberRemoval {
guild_id: GuildId,
user: User,
member_data_if_available: Option<Member>,
},
GuildMemberUpdate {
old_if_available: Option<Member>,
new: Option<Member>,
event: GuildMemberUpdateEvent,
},
GuildMembersChunk {
chunk: GuildMembersChunkEvent,
},
GuildRoleCreate {
new: Role,
},
GuildRoleDelete {
guild_id: GuildId,
removed_role_id: RoleId,
removed_role_data_if_available: Option<Role>,
},
GuildRoleUpdate {
old_data_if_available: Option<Role>,
new: Role,
},
GuildStickersUpdate {
guild_id: GuildId,
current_state: HashMap<StickerId, Sticker>,
},
GuildUpdate {
old_data_if_available: Option<Guild>,
new_data: PartialGuild,
},
InviteCreate {
data: InviteCreateEvent,
},
InviteDelete {
data: InviteDeleteEvent,
},
Message {
new_message: Message,
},
MessageDelete {
channel_id: ChannelId,
deleted_message_id: MessageId,
guild_id: Option<GuildId>,
},
MessageDeleteBulk {
channel_id: ChannelId,
multiple_deleted_messages_ids: Vec<MessageId>,
guild_id: Option<GuildId>,
},
MessageUpdate {
old_if_available: Option<Message>,
new: Option<Message>,
event: MessageUpdateEvent,
},
ReactionAdd {
add_reaction: Reaction,
},
ReactionRemove {
removed_reaction: Reaction,
},
ReactionRemoveAll {
channel_id: ChannelId,
removed_from_message_id: MessageId,
},
ReactionRemoveEmoji {
removed_reactions: Reaction,
},
PresenceReplace {
presences: Vec<Presence>,
},
PresenceUpdate {
new_data: Presence,
},
Ready {
data_about_bot: Ready,
},
Resume {
event: ResumedEvent,
},
ShardStageUpdate {
event: ShardStageUpdateEvent,
},
TypingStart {
event: TypingStartEvent,
},
UserUpdate {
old_data: Option<CurrentUser>,
new: CurrentUser,
},
VoiceServerUpdate {
event: VoiceServerUpdateEvent,
},
VoiceStateUpdate {
old: Option<VoiceState>,
new: VoiceState,
},
VoiceChannelStatusUpdate {
old: Option<String>,
status: Option<String>,
id: ChannelId,
guild_id: GuildId,
},
WebhookUpdate {
guild_id: GuildId,
belongs_to_channel_id: ChannelId,
},
InteractionCreate {
interaction: Interaction,
},
IntegrationCreate {
integration: Integration,
},
IntegrationUpdate {
integration: Integration,
},
IntegrationDelete {
integration_id: IntegrationId,
guild_id: GuildId,
application_id: Option<ApplicationId>,
},
StageInstanceCreate {
stage_instance: StageInstance,
},
StageInstanceUpdate {
stage_instance: StageInstance,
},
StageInstanceDelete {
stage_instance: StageInstance,
},
ThreadCreate {
thread: GuildChannel,
},
ThreadUpdate {
old: Option<GuildChannel>,
new: GuildChannel,
},
ThreadDelete {
thread: PartialGuildChannel,
full_thread_data: Option<GuildChannel>,
},
ThreadListSync {
thread_list_sync: ThreadListSyncEvent,
},
ThreadMemberUpdate {
thread_member: ThreadMember,
},
ThreadMembersUpdate {
thread_members_update: ThreadMembersUpdateEvent,
},
GuildScheduledEventCreate {
event: ScheduledEvent,
},
GuildScheduledEventUpdate {
event: ScheduledEvent,
},
GuildScheduledEventDelete {
event: ScheduledEvent,
},
GuildScheduledEventUserAdd {
subscribed: GuildScheduledEventUserAddEvent,
},
GuildScheduledEventUserRemove {
unsubscribed: GuildScheduledEventUserRemoveEvent,
},
EntitlementCreate {
entitlement: Entitlement,
},
EntitlementUpdate {
entitlement: Entitlement,
},
EntitlementDelete {
entitlement: Entitlement,
},
MessagePollVoteAdd {
event: MessagePollVoteAddEvent,
},
MessagePollVoteRemove {
event: MessagePollVoteRemoveEvent,
},
Ratelimit {
data: RatelimitInfo,
},
}
Expand description
This enum stores every possible event that an EventHandler
can receive.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CommandPermissionsUpdate
Dispatched when the permissions of an application command was updated.
Provides said permission’s data.
Fields
permission: CommandPermissions
AutoModRuleCreate
Dispatched when an auto moderation rule was created.
Provides said rule’s data.
AutoModRuleUpdate
Dispatched when an auto moderation rule was updated.
Provides said rule’s data.
AutoModRuleDelete
Dispatched when an auto moderation rule was deleted.
Provides said rule’s data.
AutoModActionExecution
Dispatched when an auto moderation rule was triggered and an action was executed.
Provides said action execution’s data.
Fields
execution: ActionExecution
CacheReady
Dispatched when the cache has received and inserted all data from guilds.
This process happens upon starting your bot and should be fairly quick. However, cache actions performed prior this event may fail as the data could be not inserted yet.
Provides the cached guilds’ ids.
ShardsReady
Dispatched when every shard has received a Ready event
ChannelCreate
Dispatched when a channel is created.
Provides said channel’s data.
Fields
channel: GuildChannel
CategoryCreate
Dispatched when a category is created.
Provides said category’s data.
Fields
category: GuildChannel
CategoryDelete
Dispatched when a category is deleted.
Provides said category’s data.
Fields
category: GuildChannel
ChannelDelete
Dispatched when a channel is deleted.
Provides said channel’s data.
ChannelPinsUpdate
Dispatched when a pin is added, deleted.
Provides said pin’s data.
Fields
ChannelUpdate
Dispatched when a channel is updated.
The old channel data is only provided when the cache feature is enabled.
GuildAuditLogEntryCreate
Dispatched when a new audit log entry is created.
Provides said entry’s data and the id of the guild where it was created.
GuildBanAddition
Dispatched when a user is banned from a guild.
Provides the guild’s id and the banned user’s data.
GuildBanRemoval
Dispatched when a user’s ban is lifted from a guild.
Provides the guild’s id and the lifted user’s data.
GuildCreate
Dispatched when a guild is created; or an existing guild’s data is sent to us.
Provides the guild’s data and whether the guild is new (only when cache feature is enabled).
GuildDelete
Dispatched when a guild is deleted.
Provides the partial data of the guild sent by discord, and the full data from the cache, if cache feature is enabled and the data is available.
The unavailable
flag in the partial data determines the status of the guild. If the
flag is false, the bot was removed from the guild, either by being kicked or banned. If the
flag is true, the guild went offline.
GuildEmojisUpdate
Dispatched when the emojis are updated.
Provides the guild’s id and the new state of the emojis in the guild.
GuildIntegrationsUpdate
Dispatched when a guild’s integration is added, updated or removed.
Provides the guild’s id.
GuildMemberAddition
Dispatched when a user joins a guild.
Provides the guild’s id and the user’s member data.
Note: This event will not trigger unless the “guild members” privileged intent is enabled on the bot application page.
GuildMemberRemoval
Dispatched when a user’s membership ends by leaving, getting kicked, or being banned.
Provides the guild’s id, the user’s data, and the user’s member data if cache feature is enabled and the data is available.
Note: This event will not trigger unless the “guild members” privileged intent is enabled on the bot application page.
GuildMemberUpdate
Dispatched when a member is updated (e.g their nickname is updated).
Provides the member’s old and new data (if cache feature is enabled and data is available) and the new raw data about updated fields.
Note: This event will not trigger unless the “guild members” privileged intent is enabled on the bot application page.
GuildMembersChunk
Dispatched when the data for offline members was requested.
Provides the guild’s id and the data.
Fields
chunk: GuildMembersChunkEvent
GuildRoleCreate
Dispatched when a role is created.
Provides the guild’s id and the new role’s data.
GuildRoleDelete
Dispatched when a role is deleted.
Provides the guild’s id, the role’s id and its data (if cache feature is enabled and the data is available).
GuildRoleUpdate
Dispatched when a role is updated.
Provides the guild’s id, the role’s old (if cache feature is enabled and the data is available) and new data.
GuildStickersUpdate
Dispatched when the stickers are updated.
Provides the guild’s id and the new state of the stickers in the guild.
GuildUpdate
Dispatched when the guild is updated.
Provides the guild’s old data (if cache feature is enabled and the data is available) and the new data.
InviteCreate
Dispatched when a invite is created.
Provides data about the invite.
Fields
data: InviteCreateEvent
InviteDelete
Dispatched when a invite is deleted.
Provides data about the invite.
Fields
data: InviteDeleteEvent
Message
Dispatched when a message is created.
Provides the message’s data.
MessageDelete
Dispatched when a message is deleted.
Provides the guild’s id, the channel’s id and the message’s id.
MessageDeleteBulk
Dispatched when multiple messages were deleted at once.
Provides the guild’s id, channel’s id and the deleted messages’ ids.
Fields
MessageUpdate
Dispatched when a message is updated.
Provides the message update data, as well as the actual old and new message if cache feature is enabled and the data is available.
ReactionAdd
Dispatched when a new reaction is attached to a message.
Provides the reaction’s data.
ReactionRemove
Dispatched when a reaction is detached from a message.
Provides the reaction’s data.
ReactionRemoveAll
Dispatched when all reactions of a message are detached from a message.
Provides the channel’s id and the message’s id.
ReactionRemoveEmoji
Dispatched when all reactions of a message are detached from a message.
Provides the channel’s id and the message’s id.
PresenceReplace
PresenceUpdate
Dispatched when a user’s presence is updated (e.g off -> on).
Provides the presence’s new data.
Note: This event will not trigger unless the “guild presences” privileged intent is enabled on the bot application page.
Ready
Dispatched upon startup.
Provides data about the bot and the guilds it’s in.
Resume
Dispatched upon reconnection.
Fields
event: ResumedEvent
ShardStageUpdate
Dispatched when a shard’s connection stage is updated
Provides the context of the shard and the event information about the update.
Fields
event: ShardStageUpdateEvent
TypingStart
Dispatched when a user starts typing.
Fields
event: TypingStartEvent
UserUpdate
Dispatched when the bot’s data is updated.
Provides the old (if cache feature is enabled and the data is available) and new data.
VoiceServerUpdate
Dispatched when a guild’s voice server was updated (or changed to another one).
Provides the voice server’s data.
Fields
event: VoiceServerUpdateEvent
VoiceStateUpdate
Dispatched when a user joins, leaves or moves to a voice channel.
Provides the guild’s id (if available) and the old state (if cache feature is enabled and
GatewayIntents::GUILDS
is enabled) and the new state of the guild’s voice channels.
VoiceChannelStatusUpdate
Dispatched when a voice channel’s status is updated.
Provides the status, channel’s id and the guild’s id.
WebhookUpdate
Dispatched when a guild’s webhook is updated.
Provides the guild’s id and the channel’s id the webhook belongs in.
InteractionCreate
Dispatched when an interaction is created (e.g a slash command was used or a button was clicked).
Provides the created interaction.
Fields
interaction: Interaction
IntegrationCreate
Dispatched when a guild integration is created.
Provides the created integration.
Fields
integration: Integration
IntegrationUpdate
Dispatched when a guild integration is updated.
Provides the updated integration.
Fields
integration: Integration
IntegrationDelete
Dispatched when a guild integration is deleted.
Provides the integration’s id, the id of the guild it belongs to, and its associated application id
StageInstanceCreate
Dispatched when a stage instance is created.
Provides the created stage instance.
Fields
stage_instance: StageInstance
StageInstanceUpdate
Dispatched when a stage instance is updated.
Provides the updated stage instance.
Fields
stage_instance: StageInstance
StageInstanceDelete
Dispatched when a stage instance is deleted.
Provides the deleted stage instance.
Fields
stage_instance: StageInstance
ThreadCreate
Dispatched when a thread is created or the current user is added to a private thread.
Provides the thread.
Fields
thread: GuildChannel
ThreadUpdate
Dispatched when a thread is updated.
Provides the updated thread and the old thread data, provided the thread was cached prior to dispatch.
ThreadDelete
Dispatched when a thread is deleted.
Provides the partial data about the deleted thread and, if it was present in the cache before its deletion, its full data.
ThreadListSync
Dispatched when the current user gains access to a channel.
Provides the threads the current user can access, the thread members, the guild Id, and the channel Ids of the parent channels being synced.
Fields
thread_list_sync: ThreadListSyncEvent
ThreadMemberUpdate
Dispatched when the ThreadMember
for the current user is updated.
Provides the updated thread member.
Fields
thread_member: ThreadMember
ThreadMembersUpdate
Dispatched when anyone is added to or removed from a thread. If the current user does not
have the GatewayIntents::GUILDS
, then this event will only be sent if the current user
was added to or removed from the thread.
Provides the added/removed members, the approximate member count of members in the thread, the thread Id and its guild Id.
Fields
thread_members_update: ThreadMembersUpdateEvent
GuildScheduledEventCreate
Dispatched when a scheduled event is created.
Provides data about the scheduled event.
Fields
event: ScheduledEvent
GuildScheduledEventUpdate
Dispatched when a scheduled event is updated.
Provides data about the scheduled event.
Fields
event: ScheduledEvent
GuildScheduledEventDelete
Dispatched when a scheduled event is deleted.
Provides data about the scheduled event.
Fields
event: ScheduledEvent
GuildScheduledEventUserAdd
Dispatched when a guild member has subscribed to a scheduled event.
Provides data about the subscription.
Fields
subscribed: GuildScheduledEventUserAddEvent
GuildScheduledEventUserRemove
Dispatched when a guild member has unsubscribed from a scheduled event.
Provides data about the cancelled subscription.
Fields
unsubscribed: GuildScheduledEventUserRemoveEvent
EntitlementCreate
Dispatched when a user subscribes to a SKU.
Provides data about the subscription.
Fields
entitlement: Entitlement
EntitlementUpdate
Dispatched when a user’s entitlement has been updated, such as when a subscription is renewed for the next billing period.
Provides data abut the updated subscription. If the entitlement is renewed, the
Entitlement::ends_at
field will have changed.
Fields
entitlement: Entitlement
EntitlementDelete
Dispatched when a user’s entitlement has been deleted. This happens rarely, but can occur if a subscription is refunded or otherwise deleted by Discord. Entitlements are not deleted when they expire.
Provides data about the subscription. Specifically, the Entitlement::deleted
field will
be set.
Fields
entitlement: Entitlement
MessagePollVoteAdd
Dispatched when a user votes on a message poll.
This will be dispatched multiple times if multiple answers are selected.
Fields
event: MessagePollVoteAddEvent
MessagePollVoteRemove
Dispatched when a user removes a previous vote on a poll.
Fields
event: MessagePollVoteRemoveEvent
Ratelimit
Dispatched when an HTTP rate limit is hit
Fields
data: RatelimitInfo
Implementations§
Source§impl FullEvent
impl FullEvent
Sourcepub fn snake_case_name(&self) -> &'static str
pub fn snake_case_name(&self) -> &'static str
Returns the name of this event as a snake case string
if let FullEvent::Message { .. } = &event {
assert_eq!(event.snake_case_name(), "message");
}
Sourcepub async fn dispatch(self, ctx: Context, handler: &dyn EventHandler)
pub async fn dispatch(self, ctx: Context, handler: &dyn EventHandler)
Runs the given EventHandler
’s code for this event.