pub enum BotEvent {
Message(IncomingMessage),
MessageUpdate {
chat_id: String,
message: Message,
},
Delete {
chat_id: String,
message_id: String,
},
MemberJoin {
channel_id: String,
npub: String,
},
MemberLeave {
channel_id: String,
npub: String,
},
Typing {
chat_id: String,
npub: String,
until: u64,
},
Invite {
community_id: String,
},
Removed {
community_id: String,
},
}Expand description
Every kind of inbound event a bot can observe. Delivered to VectorBot::on_event. DMs and
Community channels are unified: chat_id is the sender’s npub for a DM, the channel id for a
Community message.
Variants§
Message(IncomingMessage)
A new message (DM or Community channel).
MessageUpdate
A reaction or edit landed on an existing message; message is the updated view (inspect
.reactions / .content, keyed by message.id).
Delete
A message was deleted (cooperative delete / moderation tombstone).
MemberJoin
A member joined a Community channel.
MemberLeave
A member left (or was kicked from) a Community channel.
Typing
A member is typing in a Community channel; until is the unix-secs the indicator expires.
Invite
A Community invite arrived. Already auto-handled per InvitePolicy; surfaced for visibility
(and for Manual policy, so you can decide via VectorBot::accept_invite).
Removed
This bot was removed from a Community (kicked / banned / a leave authored on another device).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BotEvent
impl RefUnwindSafe for BotEvent
impl Send for BotEvent
impl Sync for BotEvent
impl Unpin for BotEvent
impl UnsafeUnpin for BotEvent
impl UnwindSafe for BotEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more