Enum FullEvent

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

CommandPermissionsUpdate

Dispatched when the permissions of an application command was updated.

Provides said permission’s data.

Fields

§

AutoModRuleCreate

Dispatched when an auto moderation rule was created.

Provides said rule’s data.

Fields

§rule: Rule
§

AutoModRuleUpdate

Dispatched when an auto moderation rule was updated.

Provides said rule’s data.

Fields

§rule: Rule
§

AutoModRuleDelete

Dispatched when an auto moderation rule was deleted.

Provides said rule’s data.

Fields

§rule: Rule
§

AutoModActionExecution

Dispatched when an auto moderation rule was triggered and an action was executed.

Provides said action execution’s data.

Fields

§

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.

Fields

§guilds: Vec<GuildId>
§

ShardsReady

Dispatched when every shard has received a Ready event

Fields

§total_shards: u32
§

ChannelCreate

Dispatched when a channel is created.

Provides said channel’s data.

Fields

§

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.

Fields

§messages: Option<Vec<Message>>
§

ChannelPinsUpdate

Dispatched when a pin is added, deleted.

Provides said pin’s data.

§

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.

Fields

§guild_id: GuildId
§

GuildBanAddition

Dispatched when a user is banned from a guild.

Provides the guild’s id and the banned user’s data.

Fields

§guild_id: GuildId
§banned_user: User
§

GuildBanRemoval

Dispatched when a user’s ban is lifted from a guild.

Provides the guild’s id and the lifted user’s data.

Fields

§guild_id: GuildId
§unbanned_user: User
§

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).

Fields

§guild: Guild
§is_new: Option<bool>
§

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.

Fields

§incomplete: UnavailableGuild
§

GuildEmojisUpdate

Dispatched when the emojis are updated.

Provides the guild’s id and the new state of the emojis in the guild.

Fields

§guild_id: GuildId
§current_state: HashMap<EmojiId, Emoji>
§

GuildIntegrationsUpdate

Dispatched when a guild’s integration is added, updated or removed.

Provides the guild’s id.

Fields

§guild_id: GuildId
§

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.

Fields

§new_member: Member
§

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.

Fields

§guild_id: GuildId
§user: User
§member_data_if_available: Option<Member>
§

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.

Fields

§old_if_available: Option<Member>
§

GuildMembersChunk

Dispatched when the data for offline members was requested.

Provides the guild’s id and the data.

§

GuildRoleCreate

Dispatched when a role is created.

Provides the guild’s id and the new role’s data.

Fields

§new: Role
§

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).

Fields

§guild_id: GuildId
§removed_role_id: RoleId
§removed_role_data_if_available: Option<Role>
§

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.

Fields

§old_data_if_available: Option<Role>
§new: Role
§

GuildStickersUpdate

Dispatched when the stickers are updated.

Provides the guild’s id and the new state of the stickers in the guild.

Fields

§guild_id: GuildId
§current_state: HashMap<StickerId, Sticker>
§

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.

Fields

§old_data_if_available: Option<Guild>
§new_data: PartialGuild
§

InviteCreate

Dispatched when a invite is created.

Provides data about the invite.

§

InviteDelete

Dispatched when a invite is deleted.

Provides data about the invite.

§

Message

Dispatched when a message is created.

Provides the message’s data.

Fields

§new_message: Message
§

MessageDelete

Dispatched when a message is deleted.

Provides the guild’s id, the channel’s id and the message’s id.

Fields

§channel_id: ChannelId
§deleted_message_id: MessageId
§guild_id: Option<GuildId>
§

MessageDeleteBulk

Dispatched when multiple messages were deleted at once.

Provides the guild’s id, channel’s id and the deleted messages’ ids.

Fields

§channel_id: ChannelId
§multiple_deleted_messages_ids: Vec<MessageId>
§guild_id: Option<GuildId>
§

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.

Fields

§old_if_available: Option<Message>
§

ReactionAdd

Dispatched when a new reaction is attached to a message.

Provides the reaction’s data.

Fields

§add_reaction: Reaction
§

ReactionRemove

Dispatched when a reaction is detached from a message.

Provides the reaction’s data.

Fields

§removed_reaction: Reaction
§

ReactionRemoveAll

Dispatched when all reactions of a message are detached from a message.

Provides the channel’s id and the message’s id.

Fields

§channel_id: ChannelId
§removed_from_message_id: MessageId
§

ReactionRemoveEmoji

Dispatched when all reactions of a message are detached from a message.

Provides the channel’s id and the message’s id.

Fields

§removed_reactions: Reaction
§

PresenceReplace

👎Deprecated: This event does not exist

Fields

§presences: Vec<Presence>
👎Deprecated: This event does not exist
§

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.

Fields

§new_data: Presence
§

Ready

Dispatched upon startup.

Provides data about the bot and the guilds it’s in.

Fields

§data_about_bot: Ready
§

Resume

Dispatched upon reconnection.

Fields

§

ShardStageUpdate

Dispatched when a shard’s connection stage is updated

Provides the context of the shard and the event information about the update.

§

TypingStart

Dispatched when a user starts typing.

Fields

§

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.

Fields

§

VoiceServerUpdate

Dispatched when a guild’s voice server was updated (or changed to another one).

Provides the voice server’s data.

§

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.

Fields

§status: Option<String>
§guild_id: GuildId
§

WebhookUpdate

Dispatched when a guild’s webhook is updated.

Provides the guild’s id and the channel’s id the webhook belongs in.

Fields

§guild_id: GuildId
§belongs_to_channel_id: ChannelId
§

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

Fields

§integration_id: IntegrationId
§guild_id: GuildId
§application_id: Option<ApplicationId>
§

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

§

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.

Fields

§full_thread_data: Option<GuildChannel>
§

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

§

GuildScheduledEventUpdate

Dispatched when a scheduled event is updated.

Provides data about the scheduled event.

Fields

§

GuildScheduledEventDelete

Dispatched when a scheduled event is deleted.

Provides data about the scheduled event.

Fields

§

GuildScheduledEventUserAdd

Dispatched when a guild member has subscribed to a scheduled event.

Provides data about the subscription.

§

GuildScheduledEventUserRemove

Dispatched when a guild member has unsubscribed from a scheduled event.

Provides data about the cancelled subscription.

§

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.

§

MessagePollVoteRemove

Dispatched when a user removes a previous vote on a poll.

§

Ratelimit

Dispatched when an HTTP rate limit is hit

Fields

Implementations§

Source§

impl FullEvent

Source

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");
}
Source

pub async fn dispatch(self, ctx: Context, handler: &dyn EventHandler)

Runs the given EventHandler’s code for this event.

Trait Implementations§

Source§

impl Clone for FullEvent

Source§

fn clone(&self) -> FullEvent

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FullEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneDebuggableStorage for T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> CloneableStorage for T
where T: Any + Send + Sync + Clone,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DebuggableStorage for T
where T: Any + Send + Sync + Debug,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T