From b42684900a0f2c00fdcf88d31a142ee5b5ddd361 Mon Sep 17 00:00:00 2001 From: Janik Kleinhoff Date: Fri, 6 Nov 2015 21:56:42 +0000 Subject: ;hilight: detect bad argument order --- config-default/commands.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'config-default') 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 @@ 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} = {}; } -- cgit v1.2.3