Skip to main content

Module event

Module event 

Source
Expand description

Event bodies (specification §9): the §9.2 catalogue, the stream of each event, and decoding that ignores unknown event types (§9.4).

The envelope module hands Event::parse the envelope’s type and raw body. Sequence, timestamp, actor and (for most events) channel_id are envelope fields (§7.4).

Re-exports§

pub use crate::limits::BULK_DELETE_MAX;

Structs§

BotRemoved
bot.removed: {bot_id, member_id}.
ChannelCreated
channel.created: the channel object plus reason?: "access_gained" (§9.3).
ChannelDeleted
channel.deleted: {channel_id, reason?: "access_lost"} (§9.3).
ChannelsReordered
channel.reordered: positions (only channels the member can see).
CommandsUpdated
command.updated: one bot’s whole command list ([] while disabled or removed).
DescriptorUpdated
community.descriptor_updated: signed descriptor and delegation.
DmClosed
dm.closed: to the closer’s own stream (§8.15).
InteractionAutocomplete
interaction.autocomplete: suggestions, to the invoker only.
InteractionFailed
interaction.failed, to the invoker only.
InteractionMessage
interaction.message: an ephemeral message, to the invoker only.
InteractionModal
interaction.modal: open a modal, to the invoker only.
MemberLeft
member.left: {member_id}.
MemberRemoved
member.removed: {reason}, to the subject only; then the session ends.
MemberRolesUpdated
member.roles_updated: {member_id, role_ids}.
MemberTimedOut
member.timed_out: {member_id, until}.
MembershipUpdated
membership.updated: {member_id, state, until?}.
MessageCreated
message.created (§7.4, §9.2).
MessageDeleted
message.deleted: {message_id}.
MessageUpdated
message.updated: {message_id, content, embeds?, components?, flags?, mentions?, edited_at}.
MessagesBulkDeleted
messages.bulk_deleted: {message_ids} (≤ 1 000).
PresenceSignal
signal.presence live event (§10.5).
ReactionChanged
reaction.added and reaction.removed: {message_id, emoji, member_id}.
RoleDeleted
role.deleted: {role_id}.
RolesReordered
role.reordered: positions. SPEC: the role.reorder entry is reused.
TypingSignal
signal.typing live event (§10.5): {channel_id, member_ids} in a named channel, {channel_id, count} in an anonymous one (who is typing is never sent there).
VoiceJoined
voice.joined: a member entered a voice channel. Its key_package is present only for the channel’s other participants.
VoiceKeys
voice.keys: another participant’s media key for epoch: its signed sender-keys message and the key wrapped for this participant only (never another’s).
VoiceLeft
voice.left: a member left a voice channel. The member itself receives it too.
VoiceSignal
voice.signal: WebRTC signalling from another participant, to this one only.
VoiceUpdated
voice.updated: a participant’s mute, deafen or can_speak changed.

Enums§

EphemeralOp
op of interaction.message.
Event
A decoded event body: one variant per event of the §9.2 catalogue.
FailReason
Why an interaction failed.
Parsed
The result of decoding an event: known, or an unknown type that the client ignores while still advancing the stream’s cursor by its sequence (§9.4). Events in reserved namespaces (§13) are unknown too.
RemovalReason
reason: {t: "kicked" | "banned" | "left" | "rejected" | "expired"}.
VisibilityReason
A visibility change (§9.3). SPEC: a plain string ("access_gained"), as written.
VoiceLeftReason
Why a participant left a voice channel.