= Updated color to allow for parsing even with text after it
This commit is contained in:
@@ -62,6 +62,7 @@
|
||||
"Localized Strings","BetBeansInfo","Allows you to bet your beans, set your amount after the command! Warning! House always wins!nSets of 3 will get 2x, 4 will get 10x, and 5 will get 1000x"
|
||||
"Localized Strings","BetBeansLose","Sorry, you didn't win, try again!"
|
||||
"Localized Strings","BetBeansLowBet","Please bet with at least 20 beans!"
|
||||
"Localized Strings","BetBeansMinThreshold","50"
|
||||
"Localized Strings","BetBeansNotEnough","You don't have enough beans!"
|
||||
"Localized Strings","BetBeansNotValid","That's not a valid bet!"
|
||||
"Localized Strings","BetBeansWin","You won %s beans!"
|
||||
|
||||
|
@@ -31,8 +31,28 @@ public class CommandColor extends Command
|
||||
@Override
|
||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(input.args == null || input.args.length() == 0)
|
||||
{
|
||||
res.send(LocStrings.stub("ColorNotSearchable"));
|
||||
return;
|
||||
}
|
||||
|
||||
String toFind = null;
|
||||
String[] split = input.args.split(" ");
|
||||
|
||||
if(split.length >= 1)
|
||||
toFind = split[0];
|
||||
|
||||
// First, try and parse out the color to make sure we can even get it.
|
||||
ColorData colorData = theColorAPI.lookupHex(input.args.trim());
|
||||
ColorData colorData = null;
|
||||
if(toFind == null)
|
||||
{
|
||||
colorData = theColorAPI.lookupHex(input.args.trim());
|
||||
}
|
||||
else
|
||||
{
|
||||
colorData = theColorAPI.lookupHex(toFind.trim());
|
||||
}
|
||||
|
||||
// Verify the color was even found
|
||||
if(colorData == null)
|
||||
|
||||
Reference in New Issue
Block a user