=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:
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user