Wire NickServ + ChanServ into the shared stats registry
nickserv.identify / nickserv.identify_fail and chanserv.register / chanserv.drop are now recorded via ctx.count, so the Stats API reports each module's own events, not just BotServ's.
This commit is contained in:
parent
d4e2c905f2
commit
bddf13459d
2 changed files with 4 additions and 0 deletions
|
|
@ -84,6 +84,7 @@ impl Service for ChanServ {
|
|||
match db.register_channel(chan, account) {
|
||||
Ok(()) => {
|
||||
ctx.channel_mode(me, chan, "+r"); // mark the channel registered
|
||||
ctx.count("chanserv.register");
|
||||
ctx.notice(me, from.uid, format!("\x02{chan}\x02 is now registered and you are its founder. Enjoy!"));
|
||||
}
|
||||
Err(ChanError::Exists) => ctx.notice(me, from.uid, format!("\x02{chan}\x02 is already registered. Try \x02INFO {chan}\x02 to see who owns it.")),
|
||||
|
|
@ -143,6 +144,7 @@ impl Service for ChanServ {
|
|||
match db.drop_channel(chan) {
|
||||
Ok(()) => {
|
||||
ctx.channel_mode(me, chan, "-r"); // no longer registered
|
||||
ctx.count("chanserv.drop");
|
||||
ctx.notice(me, from.uid, format!("\x02{chan}\x02 has been dropped and is no longer registered."));
|
||||
}
|
||||
Err(_) => ctx.notice(me, from.uid, "Sorry, that didn't work. Please try again in a moment."),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue