pub struct CommandContext {
pub command: String,
pub params: Vec<String>,
pub sender: String,
pub room_id: String,
pub message_id: String,
pub timestamp: DateTime<Utc>,
pub history: Box<dyn HistoryAccess>,
pub writer: Box<dyn MessageWriter>,
pub metadata: RoomMetadata,
pub available_commands: Vec<CommandInfo>,
pub team_access: Option<Box<dyn TeamAccess>>,
}Expand description
Context passed to a plugin’s handle method.
Fields§
§command: StringThe command name that was invoked (without /).
params: Vec<String>Arguments passed after the command name.
sender: StringUsername of the invoker.
room_id: StringRoom ID.
message_id: StringMessage ID that triggered this command.
timestamp: DateTime<Utc>Timestamp of the triggering message.
history: Box<dyn HistoryAccess>Scoped handle for reading chat history.
writer: Box<dyn MessageWriter>Scoped handle for writing back to the chat.
metadata: RoomMetadataSnapshot of room metadata.
available_commands: Vec<CommandInfo>All registered commands (so /help can list them without
holding a reference to the registry).
team_access: Option<Box<dyn TeamAccess>>Optional access to daemon-level team membership.
Some in daemon mode (backed by UserRegistry), None in standalone
mode where teams are not available.
Auto Trait Implementations§
impl Freeze for CommandContext
impl !RefUnwindSafe for CommandContext
impl Send for CommandContext
impl Sync for CommandContext
impl Unpin for CommandContext
impl UnsafeUnpin for CommandContext
impl !UnwindSafe for CommandContext
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
Mutably borrows from an owned value. Read more