pub enum Event {
Show 46 variants
MessageCreated(MessageCreated),
MessageUpdated(MessageUpdated),
MessageDeleted(MessageDeleted),
MessagesBulkDeleted(MessagesBulkDeleted),
ReactionAdded(ReactionChanged),
ReactionRemoved(ReactionChanged),
CommunityUpdated(CommunityProfile),
DescriptorUpdated(DescriptorUpdated),
ChannelCreated(Box<ChannelCreated>),
ChannelUpdated(Box<Channel>),
ChannelDeleted(ChannelDeleted),
ChannelReordered(ChannelsReordered),
RoleCreated(Role),
RoleUpdated(Role),
RoleDeleted(RoleDeleted),
RoleReordered(RolesReordered),
MemberRolesUpdated(MemberRolesUpdated),
MemberTimedOut(MemberTimedOut),
MemberJoined(Member),
MemberLeft(MemberLeft),
MemberUpdated(Member),
MemberRemoved(MemberRemoved),
MembershipRequested(Member),
MembershipUpdated(MembershipUpdated),
AdmissionPolicyUpdated(PolicyView),
LockdownUpdated(LockdownView),
AttachmentUpdated(Attachment),
ReportCreated(Box<Report>),
ReportUpdated(Box<Report>),
VoiceJoined(VoiceJoined),
VoiceLeft(VoiceLeft),
VoiceUpdated(VoiceUpdated),
VoiceSignal(VoiceSignal),
VoiceKeys(VoiceKeys),
SignalTyping(TypingSignal),
SignalPresence(PresenceSignal),
BotUpdated(Box<BotCard>),
BotRemoved(BotRemoved),
CommandUpdated(CommandsUpdated),
InteractionCreated(Box<Interaction>),
InteractionMessage(InteractionMessage),
InteractionModal(InteractionModal),
InteractionAutocomplete(InteractionAutocomplete),
InteractionFailed(InteractionFailed),
DmCreated(Box<Channel>),
DmClosed(DmClosed),
}Expand description
A decoded event body: one variant per event of the §9.2 catalogue.
Variants§
MessageCreated(MessageCreated)
message.created
MessageUpdated(MessageUpdated)
message.updated
MessageDeleted(MessageDeleted)
message.deleted
MessagesBulkDeleted(MessagesBulkDeleted)
messages.bulk_deleted
ReactionAdded(ReactionChanged)
reaction.added
ReactionRemoved(ReactionChanged)
reaction.removed
CommunityUpdated(CommunityProfile)
community.updated
DescriptorUpdated(DescriptorUpdated)
community.descriptor_updated
ChannelCreated(Box<ChannelCreated>)
channel.created
ChannelUpdated(Box<Channel>)
channel.updated
ChannelDeleted(ChannelDeleted)
channel.deleted
ChannelReordered(ChannelsReordered)
channel.reordered
RoleCreated(Role)
role.created
RoleUpdated(Role)
role.updated
RoleDeleted(RoleDeleted)
role.deleted
RoleReordered(RolesReordered)
role.reordered
MemberRolesUpdated(MemberRolesUpdated)
member.roles_updated
MemberTimedOut(MemberTimedOut)
member.timed_out
MemberJoined(Member)
member.joined
MemberLeft(MemberLeft)
member.left
MemberUpdated(Member)
member.updated
MemberRemoved(MemberRemoved)
member.removed
MembershipRequested(Member)
membership.requested
MembershipUpdated(MembershipUpdated)
membership.updated
AdmissionPolicyUpdated(PolicyView)
admission.policy.updated
LockdownUpdated(LockdownView)
moderation.lockdown.updated
AttachmentUpdated(Attachment)
attachment.updated
ReportCreated(Box<Report>)
report.created
ReportUpdated(Box<Report>)
report.updated
VoiceJoined(VoiceJoined)
voice.joined
VoiceLeft(VoiceLeft)
voice.left
VoiceUpdated(VoiceUpdated)
voice.updated
VoiceSignal(VoiceSignal)
voice.signal
VoiceKeys(VoiceKeys)
voice.keys
SignalTyping(TypingSignal)
signal.typing
SignalPresence(PresenceSignal)
signal.presence
BotUpdated(Box<BotCard>)
bot.updated
BotRemoved(BotRemoved)
bot.removed
CommandUpdated(CommandsUpdated)
command.updated
InteractionCreated(Box<Interaction>)
interaction.created
InteractionMessage(InteractionMessage)
interaction.message
InteractionModal(InteractionModal)
interaction.modal
InteractionAutocomplete(InteractionAutocomplete)
interaction.autocomplete
InteractionFailed(InteractionFailed)
interaction.failed
DmCreated(Box<Channel>)
dm.created
DmClosed(DmClosed)
dm.closed
Implementations§
Source§impl Event
impl Event
Source§impl Event
impl Event
Sourcepub fn parse(type_: &str, body: &str) -> Result<Parsed, BodyError>
pub fn parse(type_: &str, body: &str) -> Result<Parsed, BodyError>
Decodes an event body. Unknown types are Parsed::Unknown, never an error.
§Errors
A known event whose body is malformed, or a messages.bulk_deleted above 1 000 ids.
Sourcepub const fn stream(&self) -> Stream
pub const fn stream(&self) -> Stream
The primary stream (§9.2): the first of Event::streams.
Trait Implementations§
Source§impl Serialize for Event
Serialises the event body only (the envelope’s body); the wire name is
Event::name and goes in the envelope’s type.
impl Serialize for Event
Serialises the event body only (the envelope’s body); the wire name is
Event::name and goes in the envelope’s type.