#[non_exhaustive]
pub enum Event {
Show 53 variants
ApplicationCommandPermissionsUpdate(ApplicationCommandPermissionsUpdateEvent),
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),
GuildStickersUpdate(GuildStickersUpdateEvent),
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),
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
ApplicationCommandPermissionsUpdate(ApplicationCommandPermissionsUpdateEvent)
The permissions of an ApplicationCommand
was changed.
Fires the EventHandler::application_command_permissions_update
event.
ChannelCreate(ChannelCreateEvent)
A Channel
was created.
Fires the EventHandler::channel_create
event.
ChannelDelete(ChannelDeleteEvent)
A Channel
has been deleted.
Fires the EventHandler::channel_delete
event.
ChannelPinsUpdate(ChannelPinsUpdateEvent)
The pins for a Channel
have been updated.
Fires the EventHandler::channel_pins_update
event.
ChannelUpdate(ChannelUpdateEvent)
A Channel
has been updated.
Fires the EventHandler::channel_update
event.
GuildBanAdd(GuildBanAddEvent)
GuildBanRemove(GuildBanRemoveEvent)
GuildCreate(GuildCreateEvent)
GuildDelete(GuildDeleteEvent)
GuildEmojisUpdate(GuildEmojisUpdateEvent)
GuildIntegrationsUpdate(GuildIntegrationsUpdateEvent)
GuildMemberAdd(GuildMemberAddEvent)
GuildMemberRemove(GuildMemberRemoveEvent)
GuildMemberUpdate(GuildMemberUpdateEvent)
A member’s roles have changed
GuildMembersChunk(GuildMembersChunkEvent)
GuildRoleCreate(GuildRoleCreateEvent)
GuildRoleDelete(GuildRoleDeleteEvent)
GuildRoleUpdate(GuildRoleUpdateEvent)
GuildStickersUpdate(GuildStickersUpdateEvent)
A Sticker
was created, updated, or deleted
GuildUnavailable(GuildUnavailableEvent)
When a guild is unavailable, such as due to a Discord server outage.
GuildUpdate(GuildUpdateEvent)
InviteCreate(InviteCreateEvent)
An Invite
was created.
Fires the EventHandler::invite_create
event handler.
InviteDelete(InviteDeleteEvent)
An Invite
was deleted.
Fires the EventHandler::invite_delete
event handler.
MessageCreate(MessageCreateEvent)
MessageDelete(MessageDeleteEvent)
MessageDeleteBulk(MessageDeleteBulkEvent)
MessageUpdate(MessageUpdateEvent)
A message has been edited, either by the user or the system
PresenceUpdate(PresenceUpdateEvent)
A member’s presence state (or username or avatar) has changed
PresencesReplace(PresencesReplaceEvent)
The presence list of the user’s friends should be replaced entirely
ReactionAdd(ReactionAddEvent)
A reaction was added to a message.
Fires the EventHandler::reaction_add
event handler.
ReactionRemove(ReactionRemoveEvent)
A reaction was removed to a message.
Fires the EventHandler::reaction_remove
event handler.
ReactionRemoveAll(ReactionRemoveAllEvent)
A request was issued to remove all Reaction
s from a Message
.
Fires the EventHandler::reaction_remove_all
event handler.
Ready(ReadyEvent)
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.
Resumed(ResumedEvent)
The connection has successfully resumed after a disconnect.
TypingStart(TypingStartEvent)
A user is typing; considered to last 5 seconds
UserUpdate(UserUpdateEvent)
Update to the logged-in user’s information
VoiceStateUpdate(VoiceStateUpdateEvent)
A member’s voice state has changed
VoiceServerUpdate(VoiceServerUpdateEvent)
Voice server information is available
WebhookUpdate(WebhookUpdateEvent)
InteractionCreate(InteractionCreateEvent)
An interaction was created.
IntegrationCreate(IntegrationCreateEvent)
A guild integration was created
IntegrationUpdate(IntegrationUpdateEvent)
A guild integration was updated
IntegrationDelete(IntegrationDeleteEvent)
A guild integration was deleted
StageInstanceCreate(StageInstanceCreateEvent)
A stage instance was created.
StageInstanceUpdate(StageInstanceUpdateEvent)
A stage instance was updated.
StageInstanceDelete(StageInstanceDeleteEvent)
A stage instance was deleted.
ThreadCreate(ThreadCreateEvent)
A thread was created or the current user was added to a private thread.
ThreadUpdate(ThreadUpdateEvent)
A thread was updated.
ThreadDelete(ThreadDeleteEvent)
A thread was deleted.
ThreadListSync(ThreadListSyncEvent)
The current user gains access to a channel.
ThreadMemberUpdate(ThreadMemberUpdateEvent)
The ThreadMember
object for the current user is updated.
ThreadMembersUpdate(ThreadMembersUpdateEvent)
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.
Unknown(UnknownEvent)
An event type not covered by the above
Implementations
sourceimpl Event
impl Event
sourcepub fn event_type(&self) -> EventType
pub fn event_type(&self) -> EventType
Return the type of this event.
sourcepub fn channel_id(&self) -> RelatedId<ChannelId>
pub fn channel_id(&self) -> RelatedId<ChannelId>
Channel ID(s) related to this event.
sourcepub fn message_id(&self) -> RelatedId<MessageId>
pub fn message_id(&self) -> RelatedId<MessageId>
Message ID(s) related to this event.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more