BotServ: KICK <#channel> TEST <message> dry-run

Reports which content kicker (caps/formatting/badwords) a line would trip,
without kicking anyone — so an op can tune caps% or a badword regex safely.
Reuses the typed KickerSettings::violation() and the shared badword-set
builder (moved to db so the test and the live path share it).
This commit is contained in:
Jean Chevronnet 2026-07-13 17:53:13 +00:00
parent 9f5f0ed0d2
commit 0edc4d4e87
No known key found for this signature in database
4 changed files with 60 additions and 12 deletions

View file

@ -572,6 +572,8 @@ pub trait Store {
fn badword_del(&mut self, channel: &str, pattern: &str) -> Result<bool, ChanError>;
fn badword_clear(&mut self, channel: &str) -> Result<usize, ChanError>;
fn badwords(&self, channel: &str) -> Vec<String>;
// Dry-run the content kickers against a line; Some(reason) if it would kick.
fn kicker_test(&self, channel: &str, text: &str) -> Option<String>;
fn set_channel_topic(&mut self, channel: &str, topic: &str) -> Result<(), ChanError>;
fn suspend_channel(&mut self, channel: &str, by: &str, reason: &str, expires: Option<u64>) -> Result<(), ChanError>;
fn unsuspend_channel(&mut self, channel: &str) -> Result<bool, ChanError>;