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

#[non_exhaustive]
pub enum Event {
Show 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), 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(ChannelCreateEvent)
Expand description

A Channel was created.

Fires the EventHandler::channel_create event.

ChannelDelete(ChannelDeleteEvent)
Expand description

A Channel has been deleted.

Fires the EventHandler::channel_delete event.

ChannelPinsUpdate(ChannelPinsUpdateEvent)
Expand description

The pins for a Channel have been updated.

Fires the EventHandler::channel_pins_update event.

ChannelUpdate(ChannelUpdateEvent)
Expand description

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)
Expand description

A member’s roles have changed

GuildMembersChunk(GuildMembersChunkEvent)
GuildRoleCreate(GuildRoleCreateEvent)
GuildRoleDelete(GuildRoleDeleteEvent)
GuildRoleUpdate(GuildRoleUpdateEvent)
GuildUnavailable(GuildUnavailableEvent)
Expand description

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

GuildUpdate(GuildUpdateEvent)
InviteCreate(InviteCreateEvent)
Expand description

An Invite was created.

Fires the EventHandler::invite_create event handler.

InviteDelete(InviteDeleteEvent)
Expand description

An Invite was deleted.

Fires the EventHandler::invite_delete event handler.

MessageCreate(MessageCreateEvent)
MessageDelete(MessageDeleteEvent)
MessageDeleteBulk(MessageDeleteBulkEvent)
MessageUpdate(MessageUpdateEvent)
Expand description

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

PresenceUpdate(PresenceUpdateEvent)
Expand description

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

PresencesReplace(PresencesReplaceEvent)
Expand description

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

ReactionAdd(ReactionAddEvent)
Expand description

A reaction was added to a message.

Fires the EventHandler::reaction_add event handler.

ReactionRemove(ReactionRemoveEvent)
Expand description

A reaction was removed to a message.

Fires the EventHandler::reaction_remove event handler.

ReactionRemoveAll(ReactionRemoveAllEvent)
Expand description

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

Fires the EventHandler::reaction_remove_all event handler.

Ready(ReadyEvent)
Expand description

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)
Expand description

The connection has successfully resumed after a disconnect.

TypingStart(TypingStartEvent)
Expand description

A user is typing; considered to last 5 seconds

UserUpdate(UserUpdateEvent)
Expand description

Update to the logged-in user’s information

VoiceStateUpdate(VoiceStateUpdateEvent)
Expand description

A member’s voice state has changed

VoiceServerUpdate(VoiceServerUpdateEvent)
Expand description

Voice server information is available

WebhookUpdate(WebhookUpdateEvent)
Expand description

A webhook for a channel was updated in a Guild.

InteractionCreate(InteractionCreateEvent)
This is supported on crate feature unstable_discord_api only.
Expand description

A user used a slash command.

IntegrationCreate(IntegrationCreateEvent)
This is supported on crate feature unstable_discord_api only.
Expand description

A guild integration was created

IntegrationUpdate(IntegrationUpdateEvent)
This is supported on crate feature unstable_discord_api only.
Expand description

A guild integration was updated

IntegrationDelete(IntegrationDeleteEvent)
This is supported on crate feature unstable_discord_api only.
Expand description

A guild integration was deleted

ApplicationCommandCreate(ApplicationCommandCreateEvent)
This is supported on crate feature unstable_discord_api only.
Expand description

An application command was created

ApplicationCommandUpdate(ApplicationCommandUpdateEvent)
This is supported on crate feature unstable_discord_api only.
Expand description

An application command was updated

ApplicationCommandDelete(ApplicationCommandDeleteEvent)
This is supported on crate feature unstable_discord_api only.
Expand description

An application command was deleted

Unknown(UnknownEvent)
Expand description

An event type not covered by the above

Implementations

impl Event[src]

pub fn event_type(&self) -> EventType[src]

Return the type of this event.

Trait Implementations

impl Clone for Event[src]

fn clone(&self) -> Event[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Event[src]

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

Formats the value using the given formatter. Read more

impl<'de> Deserialize<'de> for Event[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl From<&'_ Event> for EventType[src]

fn from(event: &Event) -> EventType[src]

Performs the conversion.

impl Serialize for Event[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. 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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

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

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

fn in_current_span(self) -> Instrumented<Self>[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

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

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

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

pub fn vzip(self) -> V

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]