!dice Rolls dice, !d 2d4 rolls 2 4 sided dice.
!mode Sets modes in a channel.
!resync Gives everyone the precise chan-ops they're supposed to have.
+ !topic Sets the topic of the channel.
!abbreviations Shows all short command aliases.
!abbrev
!d !dice
!m !mode
!blist !banlist
-
+ !t !topic
WHY COUNT ALIST RESYNC
Other available commands:
- DICE INVITE GETKEY CLOSE
- CLEAR WELCOME DRONE KICKMASK
- KICK KICKBAN MLOCK KICKBANMASK
- JOIN COPY BANLIST
+ DICE INVITE GETKEY CLOSE
+ CLEAR WELCOME DRONE KICKMASK
+ KICK KICKBAN MLOCK KICKBANMASK
+ JOIN COPY BANLIST TOPIC
Note that channels will be dropped after 21 days of inactivity.
--- /dev/null
+%BChanServ TOPIC%B sets, or unsets, the current topic of the channel.
+To unset the topic, use NONE as the message.
+
+Syntax: %BTOPIC%B %U#channel%U <message|NONE>
'm' => \&mode,
'resync' => \&resync,
+
+ 'topic' => \&topic,
+ 't' => \&topic,
);
sub give_ops {
chanserv::cs_resync($user, $chan->{CHAN});
}
+ sub topic {
+ my ($user, $cmd, $chan, @args) = @_;
+ if (@args >= 1) {
+ chanserv::cs_topic($user, $chan, @args);
+ }
+ }
+
if(defined($cmdhash{$cmd})) {
return if flood_check($user);
cs_join($user, @args);
}
}
+ elsif($cmd =~ /^topic$/i) {
+ my $chan = shift @args;
+ if (@args == 0) {
+ notice($user, 'Syntax: TOPIC <#channel> <message|NONE>');
+ } else {
+ cs_topic($user, { CHAN => $chan }, @args);
+ }
+ }
else {
notice($user, "Unrecognized command \002$cmd\002.", "For help, type: \002/msg chanserv help\002");
wlog($csnick, LOG_DEBUG(), "$src tried to use $csnick $msg");
notice($user, @reply) if scalar @reply;
}
+sub cs_topic($$@) {
+ my ($user, $cn, @args) = @_;
+ my ($chan, $msg) = ($cn->{CHAN}, join(" ", @args));
+ can_do($cn, 'SETTOPIC', $user) or return undef;
+ ircd::settopic(agent($cn), $chan, get_user_nick($user), time, ($msg =~ /^none/i ? "" : $msg));
+}
+
### MISCELLANEA ###
# these are helpers and do NOT check if $cn1 or $cn2 is reg'd