summaryrefslogtreecommitdiffstats
path: root/config-default/commands.xml
diff options
context:
space:
mode:
Diffstat (limited to 'config-default/commands.xml')
-rw-r--r--config-default/commands.xml15
1 files changed, 10 insertions, 5 deletions
diff --git a/config-default/commands.xml b/config-default/commands.xml
index 06243a2..2551867 100644
--- a/config-default/commands.xml
+++ b/config-default/commands.xml
@@ -125,18 +125,23 @@
$::db->raw($conn, $event->{to}->[0], $dbh, $2);
]]>
</command>
- <command cmd="^;monitor (\S+) (yes|no)$" flag="a">
+ <command cmd="^;monitor (\S+) ?(yes|no)?$" flag="a">
<![CDATA[
my $chan = lc $1;
- my $switch = lc $2;
my $link = ASM::Util->getLink(lc $chan);
if ( lc $link ne lc $chan ) {
$conn->privmsg($event->replyto, "Error: $chan is linked to $link - use $link instead.");
return;
}
- $::channels->{channel}->{$chan}->{monitor} = $switch;
- ASM::XML->writeChannels();
- $conn->privmsg($event->replyto, "Monitor flag for $chan set to $switch");
+ if (defined($2)) {
+ my $switch = lc $2;
+ $::channels->{channel}->{$chan}->{monitor} = $switch;
+ ASM::XML->writeChannels();
+ $conn->privmsg($event->replyto, "Monitor flag for $chan set to $switch");
+ } else {
+ my $switch = $::channels->{channel}->{$chan}->{monitor};
+ $conn->privmsg($event->replyto, "Monitor flag for $chan is currently set to $switch");
+ }
]]>
</command>
<command cmd="^;help$">