chanserv: topic, invite, akick, list, status
Adds the remaining moderation and listing commands. Auto-kick masks are stored in the event log and enforced on join: a matching user is banned and kicked. Topic and invite are sourced from the ChanServ pseudoclient.
This commit is contained in:
parent
acd0e60946
commit
ba3803e01c
11 changed files with 369 additions and 7 deletions
16
modules/chanserv/topic.rs
Normal file
16
modules/chanserv/topic.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
use crate::engine::db::Db;
|
||||
use crate::engine::service::{Sender, ServiceCtx};
|
||||
|
||||
// TOPIC <#channel> <text>: set the channel topic (empty clears it).
|
||||
pub fn handle(me: &str, from: &Sender, args: &[&str], ctx: &mut ServiceCtx, db: &Db) {
|
||||
let Some(&chan) = args.get(1) else {
|
||||
ctx.notice(me, from.uid, "Syntax: TOPIC <#channel> <text>");
|
||||
return;
|
||||
};
|
||||
if !super::require_op(me, from, chan, ctx, db) {
|
||||
return;
|
||||
}
|
||||
let text = if args.len() > 2 { args[2..].join(" ") } else { String::new() };
|
||||
ctx.topic(me, chan, &text);
|
||||
ctx.notice(me, from.uid, format!("Topic for \x02{chan}\x02 updated."));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue