Enum serenity::model::event::Event[][src]

#[non_exhaustive]
pub enum Event {
Show 54 variants ChannelCreate(ChannelCreateEvent), ChannelDelete(ChannelDeleteEvent), ChannelPinsUpdate(ChannelPinsUpdateEvent), ChannelUpdate(ChannelUpdateEvent), GuildBanAdd(GuildBanAddEvent), GuildBanRemove(GuildBanRemoveEvent), GuildCreate(GuildCreateEvent), GuildDelete(GuildDeleteEvent), GuildEmojisUpdate(GuildEmojisUpdateEvent), GuildIntegrationsUpdate(GuildIntegrationsUpdateEvent), GuildMemberAdd(GuildMemberAddEvent), GuildMemberRemove(GuildMemberRemoveEvent), GuildMemberUpdate(GuildMemberUpdateEvent), GuildMembersChunk(GuildMembersChunkEvent), GuildRoleCreate(GuildRoleCreateEvent), GuildRoleDelete(GuildRoleDeleteEvent), GuildRoleUpdate(GuildRoleUpdateEvent), GuildUnavailable(GuildUnavailableEvent), GuildUpdate(GuildUpdateEvent), InviteCreate(InviteCreateEvent), InviteDelete(InviteDeleteEvent), MessageCreate(MessageCreateEvent), MessageDelete(MessageDeleteEvent), MessageDeleteBulk(MessageDeleteBulkEvent), MessageUpdate(MessageUpdateEvent), PresenceUpdate(PresenceUpdateEvent), PresencesReplace(PresencesReplaceEvent), ReactionAdd(ReactionAddEvent), ReactionRemove(ReactionRemoveEvent), ReactionRemoveAll(ReactionRemoveAllEvent), Ready(ReadyEvent), Resumed(ResumedEvent), TypingStart(TypingStartEvent), UserUpdate(UserUpdateEvent), VoiceStateUpdate(VoiceStateUpdateEvent), VoiceServerUpdate(VoiceServerUpdateEvent), WebhookUpdate(WebhookUpdateEvent), InteractionCreate(InteractionCreateEvent), IntegrationCreate(IntegrationCreateEvent), IntegrationUpdate(IntegrationUpdateEvent), IntegrationDelete(IntegrationDeleteEvent), ApplicationCommandCreate(ApplicationCommandCreateEvent), ApplicationCommandUpdate(ApplicationCommandUpdateEvent), ApplicationCommandDelete(ApplicationCommandDeleteEvent), StageInstanceCreate(StageInstanceCreateEvent), StageInstanceUpdate(StageInstanceUpdateEvent), StageInstanceDelete(StageInstanceDeleteEvent), ThreadCreate(ThreadCreateEvent), ThreadUpdate(ThreadUpdateEvent), ThreadDelete(ThreadDeleteEvent), ThreadListSync(ThreadListSyncEvent), ThreadMemberUpdate(ThreadMemberUpdateEvent), ThreadMembersUpdate(ThreadMembersUpdateEvent), Unknown(UnknownEvent),
}
Expand description

Event received over a websocket connection

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

A Channel was created.

Fires the EventHandler::channel_create event.

Tuple Fields of ChannelCreate

0: ChannelCreateEvent
ChannelDelete

A Channel has been deleted.

Fires the EventHandler::channel_delete event.

Tuple Fields of ChannelDelete

0: ChannelDeleteEvent
ChannelPinsUpdate

The pins for a Channel have been updated.

Fires the EventHandler::channel_pins_update event.

Tuple Fields of ChannelPinsUpdate

0: ChannelPinsUpdateEvent
ChannelUpdate

A Channel has been updated.

Fires the EventHandler::channel_update event.

Tuple Fields of ChannelUpdate

0: ChannelUpdateEvent
GuildBanAdd

Tuple Fields of GuildBanAdd

0: GuildBanAddEvent
GuildBanRemove

Tuple Fields of GuildBanRemove

0: GuildBanRemoveEvent
GuildCreate

Tuple Fields of GuildCreate

0: GuildCreateEvent
GuildDelete

Tuple Fields of GuildDelete

0: GuildDeleteEvent
GuildEmojisUpdate

Tuple Fields of GuildEmojisUpdate

0: GuildEmojisUpdateEvent
GuildIntegrationsUpdate

Tuple Fields of GuildIntegrationsUpdate

0: GuildIntegrationsUpdateEvent
GuildMemberAdd

Tuple Fields of GuildMemberAdd

0: GuildMemberAddEvent
GuildMemberRemove

Tuple Fields of GuildMemberRemove

0: GuildMemberRemoveEvent
GuildMemberUpdate

A member’s roles have changed

Tuple Fields of GuildMemberUpdate

0: GuildMemberUpdateEvent
GuildMembersChunk

Tuple Fields of GuildMembersChunk

0: GuildMembersChunkEvent
GuildRoleCreate

Tuple Fields of GuildRoleCreate

0: GuildRoleCreateEvent
GuildRoleDelete

Tuple Fields of GuildRoleDelete

0: GuildRoleDeleteEvent
GuildRoleUpdate

Tuple Fields of GuildRoleUpdate

0: GuildRoleUpdateEvent
GuildUnavailable

When a guild is unavailable, such as due to a Discord server outage.

Tuple Fields of GuildUnavailable

0: GuildUnavailableEvent
GuildUpdate

Tuple Fields of GuildUpdate

0: GuildUpdateEvent
InviteCreate

An Invite was created.

Fires the EventHandler::invite_create event handler.

Tuple Fields of InviteCreate

0: InviteCreateEvent
InviteDelete

An Invite was deleted.

Fires the EventHandler::invite_delete event handler.

Tuple Fields of InviteDelete

0: InviteDeleteEvent
MessageCreate

Tuple Fields of MessageCreate

0: MessageCreateEvent
MessageDelete

Tuple Fields of MessageDelete

0: MessageDeleteEvent
MessageDeleteBulk

Tuple Fields of MessageDeleteBulk

0: MessageDeleteBulkEvent
MessageUpdate

A message has been edited, either by the user or the system

Tuple Fields of MessageUpdate

0: MessageUpdateEvent
PresenceUpdate

A member’s presence state (or username or avatar) has changed

Tuple Fields of PresenceUpdate

0: PresenceUpdateEvent
PresencesReplace

The precense list of the user’s friends should be replaced entirely

Tuple Fields of PresencesReplace

0: PresencesReplaceEvent
ReactionAdd

A reaction was added to a message.

Fires the EventHandler::reaction_add event handler.

Tuple Fields of ReactionAdd

0: ReactionAddEvent
ReactionRemove

A reaction was removed to a message.

Fires the EventHandler::reaction_remove event handler.

Tuple Fields of ReactionRemove

0: ReactionRemoveEvent
ReactionRemoveAll

A request was issued to remove all Reactions from a Message.

Fires the EventHandler::reaction_remove_all event handler.

Tuple Fields of ReactionRemoveAll

0: ReactionRemoveAllEvent
Ready

The first event in a connection, containing the initial ready cache.

May also be received at a later time in the event of a reconnect.

Tuple Fields of Ready

0: ReadyEvent
Resumed

The connection has successfully resumed after a disconnect.

Tuple Fields of Resumed

0: ResumedEvent
TypingStart

A user is typing; considered to last 5 seconds

Tuple Fields of TypingStart

0: TypingStartEvent
UserUpdate

Update to the logged-in user’s information

Tuple Fields of UserUpdate

0: UserUpdateEvent
VoiceStateUpdate

A member’s voice state has changed

Tuple Fields of VoiceStateUpdate

0: VoiceStateUpdateEvent
VoiceServerUpdate

Voice server information is available

Tuple Fields of VoiceServerUpdate

0: VoiceServerUpdateEvent
WebhookUpdate

A webhook for a channel was updated in a Guild.

Tuple Fields of WebhookUpdate

0: WebhookUpdateEvent
InteractionCreate
This is supported on crate feature unstable_discord_api only.

An interaction was created.

Tuple Fields of InteractionCreate

0: InteractionCreateEvent
IntegrationCreate
This is supported on crate feature unstable_discord_api only.

A guild integration was created

Tuple Fields of IntegrationCreate

0: IntegrationCreateEvent
IntegrationUpdate
This is supported on crate feature unstable_discord_api only.

A guild integration was updated

Tuple Fields of IntegrationUpdate

0: IntegrationUpdateEvent
IntegrationDelete
This is supported on crate feature unstable_discord_api only.

A guild integration was deleted

Tuple Fields of IntegrationDelete

0: IntegrationDeleteEvent
ApplicationCommandCreate
This is supported on crate feature unstable_discord_api only.

An application command was created

Tuple Fields of ApplicationCommandCreate

0: ApplicationCommandCreateEvent
ApplicationCommandUpdate
This is supported on crate feature unstable_discord_api only.

An application command was updated

Tuple Fields of ApplicationCommandUpdate

0: ApplicationCommandUpdateEvent
ApplicationCommandDelete
This is supported on crate feature unstable_discord_api only.

An application command was deleted

Tuple Fields of ApplicationCommandDelete

0: ApplicationCommandDeleteEvent
StageInstanceCreate

A stage instance was created.

Tuple Fields of StageInstanceCreate

0: StageInstanceCreateEvent
StageInstanceUpdate

A stage instance was updated.

Tuple Fields of StageInstanceUpdate

0: StageInstanceUpdateEvent
StageInstanceDelete

A stage instance was deleted.

Tuple Fields of StageInstanceDelete

0: StageInstanceDeleteEvent
ThreadCreate

A thread was created or the current user was added to a private thread.

Tuple Fields of ThreadCreate

0: ThreadCreateEvent
ThreadUpdate

A thread was updated.

Tuple Fields of ThreadUpdate

0: ThreadUpdateEvent
ThreadDelete

A thread was deleted.

Tuple Fields of ThreadDelete

0: ThreadDeleteEvent
ThreadListSync

The current user gains access to a channel.

Tuple Fields of ThreadListSync

0: ThreadListSyncEvent
ThreadMemberUpdate

The ThreadMember object for the current user is updated.

Tuple Fields of ThreadMemberUpdate

0: ThreadMemberUpdateEvent
ThreadMembersUpdate

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.

Tuple Fields of ThreadMembersUpdate

0: ThreadMembersUpdateEvent
Unknown

An event type not covered by the above

Tuple Fields of Unknown

0: UnknownEvent

Implementations

Return the type of this event.

User ID(s) related to this event.

Guild ID related to this event.

Channel ID(s) related to this event.

Message ID(s) related to this event.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

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

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

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

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.