From 5d3298462aee77a9d4aa57fd5445a34c6f6dd67b Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 16 Nov 2016 19:14:39 -0800 Subject: [PATCH] Add error messages to a couple of commands --- PBot/ChanOpCommands.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PBot/ChanOpCommands.pm b/PBot/ChanOpCommands.pm index 281a0db5..6076c871 100644 --- a/PBot/ChanOpCommands.pm +++ b/PBot/ChanOpCommands.pm @@ -119,6 +119,10 @@ sub mute_user { return ""; } + if (not defined $channel and $from !~ m/^#/) { + return "/msg $nick Usage from private message: mute [timeout (default: 24 hours)]"; + } + if ($channel !~ m/^#/) { $length = "$channel $length"; $length = undef if $length eq ' '; @@ -127,6 +131,10 @@ sub mute_user { $channel = $from if not defined $channel; + if ($channel !~ m/^#/) { + return "/msg $nick Please specify a channel."; + } + if(not defined $target) { return "/msg $nick Usage: mute [channel [timeout (default: 24 hours)]]"; }