Skip to main content

Event

Trait Event 

Source
pub trait Event:
    Copy
    + Send
    + Sync
    + 'static
    + Sealed {
    type Payload: Send + Sync + 'static;

    const NAME: &'static str;
    const INTENTS: Intents;
}
Expand description

A typed event that can be passed to Client::on.

Implemented by the zero-sized event types on Events; sealed, so the set of events is controlled by this crate.

discord.js counterpart: a member of Events (each one a type here).

Required Associated Constants§

Source

const NAME: &'static str

The event’s name as discord.js spells it, such as "messageCreate".

Source

const INTENTS: Intents

The gateway intents Discord sends this event under: the client receives it if it requests any of them (for MessageCreate guild messages come with GUILD_MESSAGES, direct messages with DIRECT_MESSAGES). Empty for events sent without an intent, such as InteractionCreate or the client’s own lifecycle events. The client warns at login about handlers whose events none of its intents cover (D-271).

Required Associated Types§

Source

type Payload: Send + Sync + 'static

The data a handler of this event receives (behind an Arc).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Event for ApplicationCommandPermissionsUpdate

Source§

const NAME: &'static str = "applicationCommandPermissionsUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = ApplicationCommandPermissionsUpdate

Source§

impl Event for AutoModerationActionExecution

Source§

const NAME: &'static str = "autoModerationActionExecution"

Source§

const INTENTS: Intents

Source§

type Payload = AutoModerationActionExecution

Source§

impl Event for AutoModerationRuleCreate

Source§

const NAME: &'static str = "autoModerationRuleCreate"

Source§

const INTENTS: Intents

Source§

type Payload = AutoModerationRuleCreate

Source§

impl Event for AutoModerationRuleDelete

Source§

const NAME: &'static str = "autoModerationRuleDelete"

Source§

const INTENTS: Intents

Source§

type Payload = AutoModerationRuleDelete

Source§

impl Event for AutoModerationRuleUpdate

Source§

const NAME: &'static str = "autoModerationRuleUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = AutoModerationRuleUpdate

Source§

impl Event for ChannelCreate

Source§

const NAME: &'static str = "channelCreate"

Source§

const INTENTS: Intents

Source§

type Payload = ChannelCreate

Source§

impl Event for ChannelDelete

Source§

const NAME: &'static str = "channelDelete"

Source§

const INTENTS: Intents

Source§

type Payload = ChannelDelete

Source§

impl Event for ChannelInfo

Source§

const NAME: &'static str = "channelInfo"

Source§

const INTENTS: Intents

Source§

type Payload = ChannelInfo

Source§

impl Event for ChannelPinsUpdate

Source§

const NAME: &'static str = "channelPinsUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = ChannelPinsUpdate

Source§

impl Event for ChannelUpdate

Source§

const NAME: &'static str = "channelUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = ChannelUpdate

Source§

impl Event for ClientReady

Source§

const NAME: &'static str = "clientReady"

Source§

const INTENTS: Intents

Source§

type Payload = Ready

Source§

impl Event for EntitlementCreate

Source§

const NAME: &'static str = "entitlementCreate"

Source§

const INTENTS: Intents

Source§

type Payload = EntitlementCreate

Source§

impl Event for EntitlementDelete

Source§

const NAME: &'static str = "entitlementDelete"

Source§

const INTENTS: Intents

Source§

type Payload = EntitlementDelete

Source§

impl Event for EntitlementUpdate

Source§

const NAME: &'static str = "entitlementUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = EntitlementUpdate

Source§

impl Event for GuildAuditLogEntryCreate

Source§

const NAME: &'static str = "guildAuditLogEntryCreate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildAuditLogEntryCreate

Source§

impl Event for GuildAvailable

Source§

const NAME: &'static str = "guildAvailable"

Source§

const INTENTS: Intents

Source§

type Payload = GuildCreate

Source§

impl Event for GuildBanAdd

Source§

const NAME: &'static str = "guildBanAdd"

Source§

const INTENTS: Intents

Source§

type Payload = GuildBanAdd

Source§

impl Event for GuildBanRemove

Source§

const NAME: &'static str = "guildBanRemove"

Source§

const INTENTS: Intents

Source§

type Payload = GuildBanRemove

Source§

impl Event for GuildCreate

Source§

const NAME: &'static str = "guildCreate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildCreate

Source§

impl Event for GuildDelete

Source§

const NAME: &'static str = "guildDelete"

Source§

const INTENTS: Intents

Source§

type Payload = GuildDelete

Source§

impl Event for GuildEmojiCreate

Source§

const NAME: &'static str = "emojiCreate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildEmojiCreate

Source§

impl Event for GuildEmojiDelete

Source§

const NAME: &'static str = "emojiDelete"

Source§

const INTENTS: Intents

Source§

type Payload = GuildEmojiDelete

Source§

impl Event for GuildEmojiUpdate

Source§

const NAME: &'static str = "emojiUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildEmojiUpdate

Source§

impl Event for GuildEmojisUpdate

Source§

const NAME: &'static str = "guildEmojisUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildEmojisUpdate

Source§

impl Event for GuildIntegrationsUpdate

Source§

const NAME: &'static str = "guildIntegrationsUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildIntegrationsUpdate

Source§

impl Event for GuildMemberAdd

Source§

const NAME: &'static str = "guildMemberAdd"

Source§

const INTENTS: Intents

Source§

type Payload = GuildMemberAdd

Source§

impl Event for GuildMemberRemove

Source§

const NAME: &'static str = "guildMemberRemove"

Source§

const INTENTS: Intents

Source§

type Payload = GuildMemberRemove

Source§

impl Event for GuildMemberUpdate

Source§

const NAME: &'static str = "guildMemberUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildMemberUpdate

Source§

impl Event for GuildMembersChunk

Source§

const NAME: &'static str = "guildMembersChunk"

Source§

const INTENTS: Intents

Source§

type Payload = GuildMembersChunk

Source§

impl Event for GuildRoleCreate

Source§

const NAME: &'static str = "roleCreate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildRoleCreate

Source§

impl Event for GuildRoleDelete

Source§

const NAME: &'static str = "roleDelete"

Source§

const INTENTS: Intents

Source§

type Payload = GuildRoleDelete

Source§

impl Event for GuildRoleUpdate

Source§

const NAME: &'static str = "roleUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildRoleUpdate

Source§

impl Event for GuildScheduledEventCreate

Source§

const NAME: &'static str = "guildScheduledEventCreate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildScheduledEventCreate

Source§

impl Event for GuildScheduledEventDelete

Source§

const NAME: &'static str = "guildScheduledEventDelete"

Source§

const INTENTS: Intents

Source§

type Payload = GuildScheduledEventDelete

Source§

impl Event for GuildScheduledEventUpdate

Source§

const NAME: &'static str = "guildScheduledEventUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildScheduledEventUpdate

Source§

impl Event for GuildScheduledEventUserAdd

Source§

const NAME: &'static str = "guildScheduledEventUserAdd"

Source§

const INTENTS: Intents

Source§

type Payload = GuildScheduledEventUserAdd

Source§

impl Event for GuildScheduledEventUserRemove

Source§

const NAME: &'static str = "guildScheduledEventUserRemove"

Source§

const INTENTS: Intents

Source§

type Payload = GuildScheduledEventUserRemove

Source§

impl Event for GuildSoundboardSoundCreate

Source§

const NAME: &'static str = "guildSoundboardSoundCreate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildSoundboardSoundCreate

Source§

impl Event for GuildSoundboardSoundDelete

Source§

const NAME: &'static str = "guildSoundboardSoundDelete"

Source§

const INTENTS: Intents

Source§

type Payload = GuildSoundboardSoundDelete

Source§

impl Event for GuildSoundboardSoundUpdate

Source§

const NAME: &'static str = "guildSoundboardSoundUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildSoundboardSoundUpdate

Source§

impl Event for GuildSoundboardSoundsUpdate

Source§

const NAME: &'static str = "guildSoundboardSoundsUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildSoundboardSoundsUpdate

Source§

impl Event for GuildStickerCreate

Source§

const NAME: &'static str = "stickerCreate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildStickerCreate

Source§

impl Event for GuildStickerDelete

Source§

const NAME: &'static str = "stickerDelete"

Source§

const INTENTS: Intents

Source§

type Payload = GuildStickerDelete

Source§

impl Event for GuildStickerUpdate

Source§

const NAME: &'static str = "stickerUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildStickerUpdate

Source§

impl Event for GuildStickersUpdate

Source§

const NAME: &'static str = "guildStickersUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildStickersUpdate

Source§

impl Event for GuildUnavailable

Source§

const NAME: &'static str = "guildUnavailable"

Source§

const INTENTS: Intents

Source§

type Payload = GuildUnavailable

Source§

impl Event for GuildUpdate

Source§

const NAME: &'static str = "guildUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = GuildUpdate

Source§

impl Event for IntegrationCreate

Source§

const NAME: &'static str = "integrationCreate"

Source§

const INTENTS: Intents

Source§

type Payload = IntegrationCreate

Source§

impl Event for IntegrationDelete

Source§

const NAME: &'static str = "integrationDelete"

Source§

const INTENTS: Intents

Source§

type Payload = IntegrationDelete

Source§

impl Event for IntegrationUpdate

Source§

const NAME: &'static str = "integrationUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = IntegrationUpdate

Source§

impl Event for InteractionCreate

Source§

const NAME: &'static str = "interactionCreate"

Source§

const INTENTS: Intents

Source§

type Payload = InteractionCreate

Source§

impl Event for Invalidated

Source§

const NAME: &'static str = "invalidated"

Source§

const INTENTS: Intents

Source§

type Payload = Invalidated

Source§

impl Event for InviteCreate

Source§

const NAME: &'static str = "inviteCreate"

Source§

const INTENTS: Intents

Source§

type Payload = InviteCreate

Source§

impl Event for InviteDelete

Source§

const NAME: &'static str = "inviteDelete"

Source§

const INTENTS: Intents

Source§

type Payload = InviteDelete

Source§

impl Event for MessageBulkDelete

Source§

const NAME: &'static str = "messageDeleteBulk"

Source§

const INTENTS: Intents

Source§

type Payload = MessageBulkDelete

Source§

impl Event for MessageCreate

Source§

const NAME: &'static str = "messageCreate"

Source§

const INTENTS: Intents

Source§

type Payload = MessageCreate

Source§

impl Event for MessageDelete

Source§

const NAME: &'static str = "messageDelete"

Source§

const INTENTS: Intents

Source§

type Payload = MessageDelete

Source§

impl Event for MessagePollVoteAdd

Source§

const NAME: &'static str = "messagePollVoteAdd"

Source§

const INTENTS: Intents

Source§

type Payload = MessagePollVoteAdd

Source§

impl Event for MessagePollVoteRemove

Source§

const NAME: &'static str = "messagePollVoteRemove"

Source§

const INTENTS: Intents

Source§

type Payload = MessagePollVoteRemove

Source§

impl Event for MessageReactionAdd

Source§

const NAME: &'static str = "messageReactionAdd"

Source§

const INTENTS: Intents

Source§

type Payload = MessageReactionAdd

Source§

impl Event for MessageReactionRemove

Source§

const NAME: &'static str = "messageReactionRemove"

Source§

const INTENTS: Intents

Source§

type Payload = MessageReactionRemove

Source§

impl Event for MessageReactionRemoveAll

Source§

const NAME: &'static str = "messageReactionRemoveAll"

Source§

const INTENTS: Intents

Source§

type Payload = MessageReactionRemoveAll

Source§

impl Event for MessageReactionRemoveEmoji

Source§

const NAME: &'static str = "messageReactionRemoveEmoji"

Source§

const INTENTS: Intents

Source§

type Payload = MessageReactionRemoveEmoji

Source§

impl Event for MessageUpdate

Source§

const NAME: &'static str = "messageUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = MessageUpdate

Source§

impl Event for PresenceUpdate

Source§

const NAME: &'static str = "presenceUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = PresenceUpdate

Source§

impl Event for RateLimited

Source§

const NAME: &'static str = "rateLimited"

Source§

const INTENTS: Intents

Source§

type Payload = RateLimited

Source§

impl Event for Raw

Source§

impl Event for ShardDisconnect

Source§

const NAME: &'static str = "shardDisconnect"

Source§

const INTENTS: Intents

Source§

type Payload = CloseCode

Source§

impl Event for ShardError

Source§

const NAME: &'static str = "shardError"

Source§

const INTENTS: Intents

Source§

type Payload = ReceiveError

Source§

impl Event for ShardReady

Source§

const NAME: &'static str = "shardReady"

Source§

const INTENTS: Intents

Source§

type Payload = Ready

Source§

impl Event for ShardReconnecting

Source§

const NAME: &'static str = "shardReconnecting"

Source§

const INTENTS: Intents

Source§

type Payload = ShardReconnecting

Source§

impl Event for ShardResume

Source§

const NAME: &'static str = "shardResume"

Source§

const INTENTS: Intents

Source§

type Payload = ShardResume

Source§

impl Event for SoundboardSounds

Source§

const NAME: &'static str = "soundboardSounds"

Source§

const INTENTS: Intents

Source§

type Payload = SoundboardSounds

Source§

impl Event for StageInstanceCreate

Source§

const NAME: &'static str = "stageInstanceCreate"

Source§

const INTENTS: Intents

Source§

type Payload = StageInstanceCreate

Source§

impl Event for StageInstanceDelete

Source§

const NAME: &'static str = "stageInstanceDelete"

Source§

const INTENTS: Intents

Source§

type Payload = StageInstanceDelete

Source§

impl Event for StageInstanceUpdate

Source§

const NAME: &'static str = "stageInstanceUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = StageInstanceUpdate

Source§

impl Event for SubscriptionCreate

Source§

const NAME: &'static str = "subscriptionCreate"

Source§

const INTENTS: Intents

Source§

type Payload = SubscriptionCreate

Source§

impl Event for SubscriptionDelete

Source§

const NAME: &'static str = "subscriptionDelete"

Source§

const INTENTS: Intents

Source§

type Payload = SubscriptionDelete

Source§

impl Event for SubscriptionUpdate

Source§

const NAME: &'static str = "subscriptionUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = SubscriptionUpdate

Source§

impl Event for ThreadCreate

Source§

const NAME: &'static str = "threadCreate"

Source§

const INTENTS: Intents

Source§

type Payload = ThreadCreate

Source§

impl Event for ThreadDelete

Source§

const NAME: &'static str = "threadDelete"

Source§

const INTENTS: Intents

Source§

type Payload = ThreadDelete

Source§

impl Event for ThreadListSync

Source§

const NAME: &'static str = "threadListSync"

Source§

const INTENTS: Intents

Source§

type Payload = ThreadListSync

Source§

impl Event for ThreadMemberUpdate

Source§

const NAME: &'static str = "threadMemberUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = ThreadMemberUpdate

Source§

impl Event for ThreadMembersUpdate

Source§

const NAME: &'static str = "threadMembersUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = ThreadMembersUpdate

Source§

impl Event for ThreadUpdate

Source§

const NAME: &'static str = "threadUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = ThreadUpdate

Source§

impl Event for TypingStart

Source§

const NAME: &'static str = "typingStart"

Source§

const INTENTS: Intents

Source§

type Payload = TypingStart

Source§

impl Event for UserUpdate

Source§

const NAME: &'static str = "userUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = UserUpdate

Source§

impl Event for VoiceChannelEffectSend

Source§

const NAME: &'static str = "voiceChannelEffectSend"

Source§

const INTENTS: Intents

Source§

type Payload = VoiceChannelEffectSend

Source§

impl Event for VoiceChannelStartTimeUpdate

Source§

const NAME: &'static str = "voiceChannelStartTimeUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = VoiceChannelStartTimeUpdate

Source§

impl Event for VoiceChannelStatusUpdate

Source§

const NAME: &'static str = "voiceChannelStatusUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = VoiceChannelStatusUpdate

Source§

impl Event for VoiceServerUpdate

Source§

const NAME: &'static str = "voiceServerUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = VoiceServerUpdate

Source§

impl Event for VoiceStateUpdate

Source§

const NAME: &'static str = "voiceStateUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = VoiceStateUpdate

Source§

impl Event for WebhooksUpdate

Source§

const NAME: &'static str = "webhooksUpdate"

Source§

const INTENTS: Intents

Source§

type Payload = WebhooksUpdate