=Fixed Bug #4 Bot will not respond when choosing between nonitems

Fixed, edited in cheeky response when finding an empty string
This commit is contained in:
Alex Stewart
2020-03-27 03:04:37 -04:00
parent d86adaf3e2
commit 39abf08b35
+9 -1
View File
@@ -27,12 +27,20 @@ public class CommandChoose extends Command
String [] choices = input.args.split(",");
if(choices.length == 1)
if(choices.length <= 1)
{
res.send(LocStrings.stub("ChooseOne"));
return;
}
for(int i = 0; i < choices.length; i ++)
{
if (choices[i].equals(""))
{
choices[i] = "KittyBot is the best!";
}
}
res.send(String.format(LocStrings.stub("ChooseChoice"), (choices[(int) (Math.random()*choices.length)]).toString()));
}
}