summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config-default/commands.xml12
1 files changed, 11 insertions, 1 deletions
diff --git a/config-default/commands.xml b/config-default/commands.xml
index 6e12076..e43f9a4 100644
--- a/config-default/commands.xml
+++ b/config-default/commands.xml
@@ -431,7 +431,8 @@
<command cmd="^;hilight (\S+) (\S+) ?(\S*)$" flag="h">
<![CDATA[
my $chan = $1;
- my @nicks = split(/,/,$2);
+ my $nick_str = $2;
+ my @nicks = split(/,/, $nick_str);
my $level= $3;
if ($level eq '') { $level = 'info'; }
$level = lc $level;
@@ -444,6 +445,15 @@
$conn->privmsg($event->replyto, "Error: $chan is linked to $link - use $link instead.");
return;
}
+ my $chan_regex = qr/^#|^default$|^master$/;
+ if ( $chan !~ $chan_regex ) {
+ my $msg = "Error: '$chan' doesn't look like a channel to me.";
+ if ( $nick_str =~ $chan_regex ) {
+ $msg .= ' (Maybe you just specified nick and channel in the wrong order?)';
+ }
+ $conn->privmsg($event->replyto, $msg);
+ return;
+ }
unless (defined($::channels->{channel}->{$chan}->{hilights})) {
$::channels->{channel}->{$chan}->{hilights} = {};
}