pub trait EventHandler: Send + Sync {
Show 72 methods // Provided methods fn command_permissions_update<'life0, 'async_trait>( &'life0 self, ctx: Context, permission: CommandPermissions ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn auto_moderation_rule_create<'life0, 'async_trait>( &'life0 self, ctx: Context, rule: Rule ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn auto_moderation_rule_update<'life0, 'async_trait>( &'life0 self, ctx: Context, rule: Rule ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn auto_moderation_rule_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, rule: Rule ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn auto_moderation_action_execution<'life0, 'async_trait>( &'life0 self, ctx: Context, execution: ActionExecution ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn cache_ready<'life0, 'async_trait>( &'life0 self, ctx: Context, guilds: Vec<GuildId> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn shards_ready<'life0, 'async_trait>( &'life0 self, ctx: Context, total_shards: u32 ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn channel_create<'life0, 'async_trait>( &'life0 self, ctx: Context, channel: GuildChannel ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn category_create<'life0, 'async_trait>( &'life0 self, ctx: Context, category: GuildChannel ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn category_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, category: GuildChannel ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn channel_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, channel: GuildChannel, messages: Option<Vec<Message>> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn channel_pins_update<'life0, 'async_trait>( &'life0 self, ctx: Context, pin: ChannelPinsUpdateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn channel_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old: Option<GuildChannel>, new: GuildChannel ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_audit_log_entry_create<'life0, 'async_trait>( &'life0 self, ctx: Context, entry: AuditLogEntry, guild_id: GuildId ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_ban_addition<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, banned_user: User ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_ban_removal<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, unbanned_user: User ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_create<'life0, 'async_trait>( &'life0 self, ctx: Context, guild: Guild, is_new: Option<bool> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, incomplete: UnavailableGuild, full: Option<Guild> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_emojis_update<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, current_state: HashMap<EmojiId, Emoji> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_integrations_update<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_member_addition<'life0, 'async_trait>( &'life0 self, ctx: Context, new_member: Member ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_member_removal<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, user: User, member_data_if_available: Option<Member> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_member_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old_if_available: Option<Member>, new: Option<Member>, event: GuildMemberUpdateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_members_chunk<'life0, 'async_trait>( &'life0 self, ctx: Context, chunk: GuildMembersChunkEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_role_create<'life0, 'async_trait>( &'life0 self, ctx: Context, new: Role ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_role_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, removed_role_id: RoleId, removed_role_data_if_available: Option<Role> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_role_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old_data_if_available: Option<Role>, new: Role ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_stickers_update<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, current_state: HashMap<StickerId, Sticker> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old_data_if_available: Option<Guild>, new_data: PartialGuild ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn invite_create<'life0, 'async_trait>( &'life0 self, ctx: Context, data: InviteCreateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn invite_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, data: InviteDeleteEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn message<'life0, 'async_trait>( &'life0 self, ctx: Context, new_message: Message ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn message_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, channel_id: ChannelId, deleted_message_id: MessageId, guild_id: Option<GuildId> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn message_delete_bulk<'life0, 'async_trait>( &'life0 self, ctx: Context, channel_id: ChannelId, multiple_deleted_messages_ids: Vec<MessageId>, guild_id: Option<GuildId> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn message_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old_if_available: Option<Message>, new: Option<Message>, event: MessageUpdateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn reaction_add<'life0, 'async_trait>( &'life0 self, ctx: Context, add_reaction: Reaction ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn reaction_remove<'life0, 'async_trait>( &'life0 self, ctx: Context, removed_reaction: Reaction ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn reaction_remove_all<'life0, 'async_trait>( &'life0 self, ctx: Context, channel_id: ChannelId, removed_from_message_id: MessageId ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn reaction_remove_emoji<'life0, 'async_trait>( &'life0 self, ctx: Context, removed_reactions: Reaction ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn presence_replace<'life0, 'async_trait>( &'life0 self, ctx: Context, presences: Vec<Presence> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn presence_update<'life0, 'async_trait>( &'life0 self, ctx: Context, new_data: Presence ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn ready<'life0, 'async_trait>( &'life0 self, ctx: Context, data_about_bot: Ready ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn resume<'life0, 'async_trait>( &'life0 self, ctx: Context, event: ResumedEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn shard_stage_update<'life0, 'async_trait>( &'life0 self, ctx: Context, event: ShardStageUpdateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn typing_start<'life0, 'async_trait>( &'life0 self, ctx: Context, event: TypingStartEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn user_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old_data: Option<CurrentUser>, new: CurrentUser ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn voice_server_update<'life0, 'async_trait>( &'life0 self, ctx: Context, event: VoiceServerUpdateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn voice_state_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old: Option<VoiceState>, new: VoiceState ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn voice_channel_status_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old: Option<String>, status: Option<String>, id: ChannelId, guild_id: GuildId ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn webhook_update<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, belongs_to_channel_id: ChannelId ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn interaction_create<'life0, 'async_trait>( &'life0 self, ctx: Context, interaction: Interaction ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn integration_create<'life0, 'async_trait>( &'life0 self, ctx: Context, integration: Integration ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn integration_update<'life0, 'async_trait>( &'life0 self, ctx: Context, integration: Integration ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn integration_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, integration_id: IntegrationId, guild_id: GuildId, application_id: Option<ApplicationId> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn stage_instance_create<'life0, 'async_trait>( &'life0 self, ctx: Context, stage_instance: StageInstance ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn stage_instance_update<'life0, 'async_trait>( &'life0 self, ctx: Context, stage_instance: StageInstance ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn stage_instance_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, stage_instance: StageInstance ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn thread_create<'life0, 'async_trait>( &'life0 self, ctx: Context, thread: GuildChannel ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn thread_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old: Option<GuildChannel>, new: GuildChannel ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn thread_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, thread: PartialGuildChannel, full_thread_data: Option<GuildChannel> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn thread_list_sync<'life0, 'async_trait>( &'life0 self, ctx: Context, thread_list_sync: ThreadListSyncEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn thread_member_update<'life0, 'async_trait>( &'life0 self, ctx: Context, thread_member: ThreadMember ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn thread_members_update<'life0, 'async_trait>( &'life0 self, ctx: Context, thread_members_update: ThreadMembersUpdateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_scheduled_event_create<'life0, 'async_trait>( &'life0 self, ctx: Context, event: ScheduledEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_scheduled_event_update<'life0, 'async_trait>( &'life0 self, ctx: Context, event: ScheduledEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_scheduled_event_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, event: ScheduledEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_scheduled_event_user_add<'life0, 'async_trait>( &'life0 self, ctx: Context, subscribed: GuildScheduledEventUserAddEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_scheduled_event_user_remove<'life0, 'async_trait>( &'life0 self, ctx: Context, unsubscribed: GuildScheduledEventUserRemoveEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn entitlement_create<'life0, 'async_trait>( &'life0 self, ctx: Context, entitlement: Entitlement ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn entitlement_update<'life0, 'async_trait>( &'life0 self, ctx: Context, entitlement: Entitlement ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn entitlement_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, entitlement: Entitlement ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn ratelimit<'life0, 'async_trait>( &'life0 self, data: RatelimitInfo ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Available on crate features gateway and client only.
Expand description

The core trait for handling events by serenity.

Provided Methods§

source

fn command_permissions_update<'life0, 'async_trait>( &'life0 self, ctx: Context, permission: CommandPermissions ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when the permissions of an application command was updated.

Provides said permission’s data.

source

fn auto_moderation_rule_create<'life0, 'async_trait>( &'life0 self, ctx: Context, rule: Rule ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when an auto moderation rule was created.

Provides said rule’s data.

source

fn auto_moderation_rule_update<'life0, 'async_trait>( &'life0 self, ctx: Context, rule: Rule ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when an auto moderation rule was updated.

Provides said rule’s data.

source

fn auto_moderation_rule_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, rule: Rule ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when an auto moderation rule was deleted.

Provides said rule’s data.

source

fn auto_moderation_action_execution<'life0, 'async_trait>( &'life0 self, ctx: Context, execution: ActionExecution ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

Provides said action execution’s data.

source

fn cache_ready<'life0, 'async_trait>( &'life0 self, ctx: Context, guilds: Vec<GuildId> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature cache only.

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.

source

fn shards_ready<'life0, 'async_trait>( &'life0 self, ctx: Context, total_shards: u32 ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature cache only.

Dispatched when every shard has received a Ready event

source

fn channel_create<'life0, 'async_trait>( &'life0 self, ctx: Context, channel: GuildChannel ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a channel is created.

Provides said channel’s data.

source

fn category_create<'life0, 'async_trait>( &'life0 self, ctx: Context, category: GuildChannel ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a category is created.

Provides said category’s data.

source

fn category_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, category: GuildChannel ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a category is deleted.

Provides said category’s data.

source

fn channel_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, channel: GuildChannel, messages: Option<Vec<Message>> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a channel is deleted.

Provides said channel’s data.

source

fn channel_pins_update<'life0, 'async_trait>( &'life0 self, ctx: Context, pin: ChannelPinsUpdateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a pin is added, deleted.

Provides said pin’s data.

source

fn channel_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old: Option<GuildChannel>, new: GuildChannel ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a channel is updated.

The old channel data is only provided when the cache feature is enabled.

source

fn guild_audit_log_entry_create<'life0, 'async_trait>( &'life0 self, ctx: Context, entry: AuditLogEntry, guild_id: GuildId ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a new audit log entry is created.

Provides said entry’s data and the id of the guild where it was created.

source

fn guild_ban_addition<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, banned_user: User ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a user is banned from a guild.

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

source

fn guild_ban_removal<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, unbanned_user: User ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

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

source

fn guild_create<'life0, 'async_trait>( &'life0 self, ctx: Context, guild: Guild, is_new: Option<bool> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

source

fn guild_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, incomplete: UnavailableGuild, full: Option<Guild> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn guild_emojis_update<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, current_state: HashMap<EmojiId, Emoji> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when the emojis are updated.

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

source

fn guild_integrations_update<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

Provides the guild’s id.

source

fn guild_member_addition<'life0, 'async_trait>( &'life0 self, ctx: Context, new_member: Member ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn guild_member_removal<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, user: User, member_data_if_available: Option<Member> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn guild_member_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old_if_available: Option<Member>, new: Option<Member>, event: GuildMemberUpdateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn guild_members_chunk<'life0, 'async_trait>( &'life0 self, ctx: Context, chunk: GuildMembersChunkEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when the data for offline members was requested.

Provides the guild’s id and the data.

source

fn guild_role_create<'life0, 'async_trait>( &'life0 self, ctx: Context, new: Role ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a role is created.

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

source

fn guild_role_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, removed_role_id: RoleId, removed_role_data_if_available: Option<Role> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

source

fn guild_role_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old_data_if_available: Option<Role>, new: Role ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn guild_stickers_update<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, current_state: HashMap<StickerId, Sticker> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when the stickers are updated.

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

source

fn guild_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old_data_if_available: Option<Guild>, new_data: PartialGuild ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn invite_create<'life0, 'async_trait>( &'life0 self, ctx: Context, data: InviteCreateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a invite is created.

Provides data about the invite.

source

fn invite_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, data: InviteDeleteEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a invite is deleted.

Provides data about the invite.

source

fn message<'life0, 'async_trait>( &'life0 self, ctx: Context, new_message: Message ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a message is created.

Provides the message’s data.

source

fn message_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, channel_id: ChannelId, deleted_message_id: MessageId, guild_id: Option<GuildId> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a message is deleted.

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

source

fn message_delete_bulk<'life0, 'async_trait>( &'life0 self, ctx: Context, channel_id: ChannelId, multiple_deleted_messages_ids: Vec<MessageId>, guild_id: Option<GuildId> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when multiple messages were deleted at once.

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

source

fn message_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old_if_available: Option<Message>, new: Option<Message>, event: MessageUpdateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn reaction_add<'life0, 'async_trait>( &'life0 self, ctx: Context, add_reaction: Reaction ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a new reaction is attached to a message.

Provides the reaction’s data.

source

fn reaction_remove<'life0, 'async_trait>( &'life0 self, ctx: Context, removed_reaction: Reaction ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a reaction is detached from a message.

Provides the reaction’s data.

source

fn reaction_remove_all<'life0, 'async_trait>( &'life0 self, ctx: Context, channel_id: ChannelId, removed_from_message_id: MessageId ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

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

source

fn reaction_remove_emoji<'life0, 'async_trait>( &'life0 self, ctx: Context, removed_reactions: Reaction ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

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

source

fn presence_replace<'life0, 'async_trait>( &'life0 self, ctx: Context, presences: Vec<Presence> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

This event is legacy, and likely no longer sent by discord.

source

fn presence_update<'life0, 'async_trait>( &'life0 self, ctx: Context, new_data: Presence ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn ready<'life0, 'async_trait>( &'life0 self, ctx: Context, data_about_bot: Ready ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched upon startup.

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

source

fn resume<'life0, 'async_trait>( &'life0 self, ctx: Context, event: ResumedEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched upon reconnection.

source

fn shard_stage_update<'life0, 'async_trait>( &'life0 self, ctx: Context, event: ShardStageUpdateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a shard’s connection stage is updated

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

source

fn typing_start<'life0, 'async_trait>( &'life0 self, ctx: Context, event: TypingStartEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a user starts typing.

source

fn user_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old_data: Option<CurrentUser>, new: CurrentUser ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when the bot’s data is updated.

Provides the old (if cache feature is enabled and the data is available) and new data.

source

fn voice_server_update<'life0, 'async_trait>( &'life0 self, ctx: Context, event: VoiceServerUpdateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

Provides the voice server’s data.

source

fn voice_state_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old: Option<VoiceState>, new: VoiceState ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn voice_channel_status_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old: Option<String>, status: Option<String>, id: ChannelId, guild_id: GuildId ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a voice channel’s status is updated.

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

source

fn webhook_update<'life0, 'async_trait>( &'life0 self, ctx: Context, guild_id: GuildId, belongs_to_channel_id: ChannelId ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a guild’s webhook is updated.

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

source

fn interaction_create<'life0, 'async_trait>( &'life0 self, ctx: Context, interaction: Interaction ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when an interaction is created (e.g a slash command was used or a button was clicked).

Provides the created interaction.

source

fn integration_create<'life0, 'async_trait>( &'life0 self, ctx: Context, integration: Integration ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a guild integration is created.

Provides the created integration.

source

fn integration_update<'life0, 'async_trait>( &'life0 self, ctx: Context, integration: Integration ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a guild integration is updated.

Provides the updated integration.

source

fn integration_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, integration_id: IntegrationId, guild_id: GuildId, application_id: Option<ApplicationId> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

source

fn stage_instance_create<'life0, 'async_trait>( &'life0 self, ctx: Context, stage_instance: StageInstance ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a stage instance is created.

Provides the created stage instance.

source

fn stage_instance_update<'life0, 'async_trait>( &'life0 self, ctx: Context, stage_instance: StageInstance ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a stage instance is updated.

Provides the updated stage instance.

source

fn stage_instance_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, stage_instance: StageInstance ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a stage instance is deleted.

Provides the deleted stage instance.

source

fn thread_create<'life0, 'async_trait>( &'life0 self, ctx: Context, thread: GuildChannel ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a thread is created or the current user is added to a private thread.

Provides the thread.

source

fn thread_update<'life0, 'async_trait>( &'life0 self, ctx: Context, old: Option<GuildChannel>, new: GuildChannel ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a thread is updated.

Provides the updated thread and the old thread data, provided the thread was cached prior to dispatch.

source

fn thread_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, thread: PartialGuildChannel, full_thread_data: Option<GuildChannel> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn thread_list_sync<'life0, 'async_trait>( &'life0 self, ctx: Context, thread_list_sync: ThreadListSyncEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn thread_member_update<'life0, 'async_trait>( &'life0 self, ctx: Context, thread_member: ThreadMember ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when the ThreadMember for the current user is updated.

Provides the updated thread member.

source

fn thread_members_update<'life0, 'async_trait>( &'life0 self, ctx: Context, thread_members_update: ThreadMembersUpdateEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn guild_scheduled_event_create<'life0, 'async_trait>( &'life0 self, ctx: Context, event: ScheduledEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a scheduled event is created.

Provides data about the scheduled event.

source

fn guild_scheduled_event_update<'life0, 'async_trait>( &'life0 self, ctx: Context, event: ScheduledEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a scheduled event is updated.

Provides data about the scheduled event.

source

fn guild_scheduled_event_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, event: ScheduledEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a scheduled event is deleted.

Provides data about the scheduled event.

source

fn guild_scheduled_event_user_add<'life0, 'async_trait>( &'life0 self, ctx: Context, subscribed: GuildScheduledEventUserAddEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

Provides data about the subscription.

source

fn guild_scheduled_event_user_remove<'life0, 'async_trait>( &'life0 self, ctx: Context, unsubscribed: GuildScheduledEventUserRemoveEvent ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

Provides data about the cancelled subscription.

source

fn entitlement_create<'life0, 'async_trait>( &'life0 self, ctx: Context, entitlement: Entitlement ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when a user subscribes to a SKU.

Provides data about the subscription.

source

fn entitlement_update<'life0, 'async_trait>( &'life0 self, ctx: Context, entitlement: Entitlement ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn entitlement_delete<'life0, 'async_trait>( &'life0 self, ctx: Context, entitlement: Entitlement ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

source

fn ratelimit<'life0, 'async_trait>( &'life0 self, data: RatelimitInfo ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dispatched when an HTTP rate limit is hit

Implementors§