Enum discord::model::Event [] [src]

pub enum Event {
    Ready(ReadyEvent),
    UserUpdate(CurrentUser),
    UserSettingsUpdate {
        enable_tts_command: Option<bool>,
        inline_attachment_media: Option<bool>,
        inline_embed_media: Option<bool>,
        locale: Option<String>,
        message_display_compact: Option<bool>,
        render_embeds: Option<bool>,
        show_current_game: Option<bool>,
        theme: Option<String>,
        convert_emoticons: Option<bool>,
        allow_email_friend_request: Option<bool>,
        friend_source_flags: Option<FriendSourceFlags>,
    },
    UserServerSettingsUpdate(UserServerSettings),
    VoiceStateUpdate(ServerId, VoiceState),
    VoiceServerUpdate {
        server_id: ServerId,
        endpoint: Option<String>,
        token: String,
    },
    TypingStart {
        channel_id: ChannelId,
        user_id: UserId,
        timestamp: u64,
    },
    PresenceUpdate {
        presence: Presence,
        server_id: Option<ServerId>,
        roles: Option<Vec<RoleId>>,
    },
    PresencesReplace(Vec<Presence>),
    RelationshipAdd(Relationship),
    RelationshipRemove(UserId, RelationshipType),
    MessageCreate(Message),
    MessageUpdate {
        id: MessageId,
        channel_id: ChannelId,
        content: Option<String>,
        nonce: Option<String>,
        tts: Option<bool>,
        timestamp: Option<String>,
        edited_timestamp: Option<String>,
        author: Option<User>,
        mention_everyone: Option<bool>,
        mentions: Option<Vec<User>>,
        attachments: Option<Vec<Attachment>>,
        embeds: Option<Vec<Value>>,
    },
    MessageAck {
        channel_id: ChannelId,
        message_id: Option<MessageId>,
    },
    MessageDelete {
        channel_id: ChannelId,
        message_id: MessageId,
    },
    ServerCreate(LiveServer),
    ServerUpdate(Server),
    ServerDelete(Server),
    ServerMemberAdd(ServerId, Member),
    ServerMemberUpdate {
        server_id: ServerId,
        roles: Vec<RoleId>,
        user: User,
    },
    ServerMemberRemove(ServerId, User),
    ServerMembersChunk(ServerId, Vec<Member>),
    ServerRoleCreate(ServerId, Role),
    ServerRoleUpdate(ServerId, Role),
    ServerRoleDelete(ServerId, RoleId),
    ServerBanAdd(ServerId, User),
    ServerBanRemove(ServerId, User),
    ServerIntegrationsUpdate(ServerId),
    ServerEmojisUpdate(ServerId, Vec<Emoji>),
    ChannelCreate(Channel),
    ChannelUpdate(Channel),
    ChannelDelete(Channel),
    GatewayChanged(String, ReadyEvent),
    Unknown(String, BTreeMap<String, Value>),
    Closed(u16),
    // some variants omitted
}

Event received over a websocket connection

Variants

Ready

The first event in a connection, containing the initial state

UserUpdate

Update to the logged-in user's information

UserSettingsUpdate

Update to the logged-in user's preferences or client settings

Fields

enable_tts_command
inline_attachment_media
inline_embed_media
locale
message_display_compact
render_embeds
show_current_game
theme
convert_emoticons
allow_email_friend_request
friend_source_flags
UserServerSettingsUpdate

Update to the logged-in user's server-specific notification settings

VoiceStateUpdate

A member's voice state has changed

VoiceServerUpdate

Voice server information is available

Fields

server_id
endpoint
token
TypingStart

A user is typing; considered to last 5 seconds

Fields

channel_id
user_id
timestamp
PresenceUpdate

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

Fields

presence
server_id
roles
PresencesReplace

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

RelationshipAdd
RelationshipRemove
MessageCreate
MessageUpdate

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

Fields

id
channel_id
content
nonce
tts
timestamp
edited_timestamp
author
mention_everyone
mentions
attachments
embeds
MessageAck

Another logged-in device acknowledged this message

Fields

channel_id
message_id

May be None if a private channel with no messages has closed.

MessageDelete

Fields

channel_id
message_id
ServerCreate
ServerUpdate
ServerDelete
ServerMemberAdd
ServerMemberUpdate

A member's roles have changed

Fields

server_id
roles
user
ServerMemberRemove
ServerMembersChunk
ServerRoleCreate
ServerRoleUpdate
ServerRoleDelete
ServerBanAdd
ServerBanRemove
ServerIntegrationsUpdate
ServerEmojisUpdate
ChannelCreate
ChannelUpdate
ChannelDelete
GatewayChanged

The connection's gateway has changed and a new Ready is available

Unknown

An event type not covered by the above

Closed

A websocket "close" frame with the given status

Methods

impl Event
[src]

fn decode(value: Value) -> Result<Event>

Trait Implementations

Derived Implementations

impl Clone for Event
[src]

fn clone(&self) -> Event

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Debug for Event
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.