diff options
Diffstat (limited to 'calc.pl')
-rw-r--r-- | calc.pl | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -136,7 +136,12 @@ sub on_public_msg { $prefix = ""; } - if($msg !~ /^!(calc|bin|hex)\s+(.+)/) { + if($msg !~ /^!(calc|bin|hex)(?:\s+(.+))?/) { + return; + } + + if((!defined $2) || (lc $2 eq 'help') || (lc $2 eq '--help')) { + $server->command("msg $target $helpmsg"); return; } @@ -146,11 +151,6 @@ sub on_public_msg { my $input = lc $2; utf8::decode($input); - if($input =~ /^-*h(?:elp)?/) { - $server->command("msg $target $helpmsg"); - return; - } - expand_vars($input, $target); my ($err, $result) = calc($input, $hex, $bin); |