Browse Source

Still return a help suggestion if an empty command is sent.

Douglas William Thrift 13 years ago
parent
commit
8cb2c6bf7f
1 changed files with 9 additions and 7 deletions
  1. 9 7
      src/net/douglasthrift/bigscreenbot/BigScreenBot.java

+ 9 - 7
src/net/douglasthrift/bigscreenbot/BigScreenBot.java

@@ -539,16 +539,18 @@ public class BigScreenBot extends Bot
         message = Colors.removeFormattingAndColors(message);
 
         String[] arguments = StringUtils.split(message, null, 2);
+        String argument = "";
+        Command command = null;
 
-        if (arguments.length == 0)
-            return;
-
-        String argument = arguments[0].toLowerCase();
+        if (arguments.length != 0)
+        {
+            argument = arguments[0].toLowerCase();
 
-        if (argument.startsWith("!"))
-            argument = argument.substring(1);
+            if (argument.startsWith("!"))
+                argument = argument.substring(1);
 
-        Command command = commands.get(argument);
+            command = commands.get(argument);
+        }
 
         if (channel != null)
         {