pub enum Event {
Show 43 variants
Ready(Community),
AppsReady(Community),
PresencesReady(Community),
PresenceUpdate {
community: Community,
presence: Presence,
},
CommandsUpdate {
community: Community,
bot: BotId,
},
BotUpdate {
community: Community,
card: Box<BotCard>,
},
BotRemove {
community: Community,
bot: BotId,
member: Member,
},
InteractionCreate(Box<Interaction>),
InteractionReply(EphemeralReply),
ModalOpen(ModalOpen),
Autocomplete(Suggestions),
InteractionFail(InteractionFailure),
MessageCreate(Message),
MessageUpdate {
message: PartialMessage,
author: Option<Member>,
content: String,
embeds: Option<Vec<Embed>>,
mentions: Option<Mentions>,
edited_at: u64,
},
MessageDelete {
message: PartialMessage,
by: Option<Member>,
},
MessageDeleteBulk {
channel: Channel,
messages: Vec<PartialMessage>,
},
ReactionAdd(Reaction),
ReactionRemove(Reaction),
ChannelCreate(Channel),
ChannelUpdate(Channel),
ChannelDelete(Channel),
RoleCreate(Role),
RoleUpdate(Role),
RoleDelete(Role),
MemberAdd(Member),
MemberUpdate(Member),
MemberRemove(Member),
VoiceStateUpdate(VoiceState),
CommunityUpdate(Community),
CommunityDelete {
community: Community,
reason: RemovalReason,
},
CommunityMoving {
community: Community,
host: HostId,
},
CommunityMoved {
community: Community,
host: HostId,
},
CommunityMoveRefused {
community: Community,
code: String,
},
Disconnect(Community),
Offline,
Online,
Warning(String),
DmCreate {
channel: Channel,
recipient: Member,
},
DmDelete(Channel),
MessageSent {
pending: u64,
message: Message,
},
MessageSendFailed {
pending: u64,
channel: Channel,
error: String,
},
TypingStart {
channel: Channel,
typing: TypingNow,
},
Raw {
community: Community,
channel: Option<Channel>,
actor: Option<Member>,
event: Box<Event>,
},
}Expand description
One thing that happened.
Variants§
Ready(Community)
A community is connected and its cache loaded: after a join, a creation, a restart, or the host coming back.
AppsReady(Community)
The community’s bots and their commands loaded (just after Event::Ready).
PresencesReady(Community)
Who is online loaded (just after Event::Ready); Community::presences has it.
PresenceUpdate
A member’s status or activity changed; offline members leave
Community::presences.
CommandsUpdate
A bot’s commands changed (Community::commands has the new list).
BotUpdate
A bot was installed, updated, re-granted, enabled, disabled or crashed: its card.
BotRemove
A bot was removed.
InteractionCreate(Box<Interaction>)
As a bot: someone used one of this bot’s commands, components or modals.
InteractionReply(EphemeralReply)
A bot’s ephemeral reply to this member.
ModalOpen(ModalOpen)
A bot asks this member to fill in a modal.
Autocomplete(Suggestions)
A bot’s autocomplete suggestions.
InteractionFail(InteractionFailure)
One of this member’s interactions got no answer.
MessageCreate(Message)
A new message.
MessageUpdate
A message was edited by its author.
Fields
message: PartialMessageThe message.
Its author, when the host said (only an author edits).
embeds: Option<Vec<Embed>>Its new embeds; None when the edit left them as they were, Some of none when
it removed them all.
MessageDelete
A message was deleted.
MessageDeleteBulk
Several messages were deleted at once.
ReactionAdd(Reaction)
Someone added a reaction.
ReactionRemove(Reaction)
Someone took a reaction off.
ChannelCreate(Channel)
A channel was made, or became visible to this member.
ChannelUpdate(Channel)
A channel changed.
ChannelDelete(Channel)
A channel was deleted, or is no longer visible to this member.
RoleCreate(Role)
A role was made.
RoleUpdate(Role)
A role changed.
RoleDelete(Role)
A role was deleted.
MemberAdd(Member)
Someone joined the community.
MemberUpdate(Member)
A member changed: their name, roles or timeout.
MemberRemove(Member)
A member left or was removed.
VoiceStateUpdate(VoiceState)
Someone joined, left or changed state in a voice channel.
CommunityUpdate(Community)
The community’s profile changed.
CommunityDelete
This client left a community, or was removed from it (kicked, banned, …); it is
forgotten here, keys and saved state included. A removal while this client was away
comes on its next session, from a host after 0.4.0 (which says it again after a
welcome without the binding, or sends an uncorrelated BANNED).
CommunityMoving
The owner handed the community to a new host; this client is moving there.
CommunityMoved
This client moved with its community to the new host.
CommunityMoveRefused
The new host refused this member; the move is given up.
Disconnect(Community)
The connection to a community’s host closed; the community stays saved.
Offline
No SimpleX relay is reachable.
Online
A relay is reachable again.
Warning(String)
Something was ignored safely; the text names no content or secret.
DmCreate
DM: a direct message became known: opened by either side, or found when the
community loaded. recipient is the other participant.
Fields
channel: ChannelThe DM’s channel; post with Channel::send.
DmDelete(Channel)
DM: this member closed a direct message.
MessageSent
A post made with Channel::send_pending is in: the
host accepted it as message, which replaces the pending one shown (matched by
pending). Its message.created may also arrive as a Event::MessageCreate.
Fields
pending: u64The PendingMessage::pending number.
MessageSendFailed
A post made with Channel::send_pending did not go
through; the pending one shown should say so.
Fields
pending: u64The PendingMessage::pending number.
TypingStart
Someone else is typing in a channel (typing): members by id in a named channel, only
how many in an anonymous one. It shows for TYPING_SHOWN_MS
unless repeated; Channel::typing gives the current state.
Raw
Any other community event, as the protocol has it.