BotServ: add SAY and ACT

The channel's assigned bot can now speak: SAY <#channel> <text> and ACT
<#channel> <text> (CTCP ACTION), gated on channel-operator access. Bots
are tracked in the network view so uid_by_nick resolves them, and the
message is sourced from the bot's own uid via a new ServiceCtx::privmsg.
This commit is contained in:
Jean Chevronnet 2026-07-13 14:15:20 +00:00
parent 6a37d010b8
commit c7d05a8b77
No known key found for this signature in database
5 changed files with 129 additions and 4 deletions

View file

@ -178,6 +178,16 @@ impl ServiceCtx {
});
}
// A channel/target message sourced from one of our pseudo-clients (e.g. a
// bot answering a fantasy command, or BotServ SAY).
pub fn privmsg(&mut self, from: &str, to: &str, text: impl Into<String>) {
self.actions.push(NetAction::Privmsg {
from: from.to_string(),
to: to.to_string(),
text: text.into(),
});
}
// Hand a registration to the engine to finish: its password derivation runs
// off the reactor, then the engine commits it and answers `reply`.
pub fn defer_register(&mut self, account: impl Into<String>, password: impl Into<String>, email: Option<String>, reply: RegReply) {