Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -27,5 +27,6 @@
|
|||||||
<classpathentry kind="lib" path="lib/google-http-client-1.32.0.jar"/>
|
<classpathentry kind="lib" path="lib/google-http-client-1.32.0.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/google-api-services-youtube-v3-rev212-1.25.0.jar"/>
|
<classpathentry kind="lib" path="lib/google-api-services-youtube-v3-rev212-1.25.0.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/LavaPlayerJar-0.0.1-jar-with-dependencies.jar"/>
|
<classpathentry kind="lib" path="lib/LavaPlayerJar-0.0.1-jar-with-dependencies.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/nanohttpd-2.3.1.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
+2
-2
@@ -50,7 +50,7 @@
|
|||||||
"Localized Commands","stats",""
|
"Localized Commands","stats",""
|
||||||
"Localized Commands","teey",""
|
"Localized Commands","teey",""
|
||||||
"Localized Commands","tony, stark, dontfeelgood, dontfeelsogood","tony, stark, dontfeelgood, dontfeelsogood, snap"
|
"Localized Commands","tony, stark, dontfeelgood, dontfeelsogood","tony, stark, dontfeelgood, dontfeelsogood, snap"
|
||||||
"Localized Commands","tradebeans",""
|
"Localized Commands","tradebeans, trade",""
|
||||||
"Localized Commands","tweet",""
|
"Localized Commands","tweet",""
|
||||||
"Localized Commands","vote",""
|
"Localized Commands","vote",""
|
||||||
"Localized Commands","wolfram",""
|
"Localized Commands","wolfram",""
|
||||||
@@ -323,7 +323,7 @@
|
|||||||
"Command Enabler","stats","1"
|
"Command Enabler","stats","1"
|
||||||
"Command Enabler","teey","1"
|
"Command Enabler","teey","1"
|
||||||
"Command Enabler","tony, stark, dontfeelgood, dontfeelsogood","1"
|
"Command Enabler","tony, stark, dontfeelgood, dontfeelsogood","1"
|
||||||
"Command Enabler","tradebeans","1"
|
"Command Enabler","tradebeans, trade","1"
|
||||||
"Command Enabler","tweet","1"
|
"Command Enabler","tweet","1"
|
||||||
"Command Enabler","vote","1"
|
"Command Enabler","vote","1"
|
||||||
"Command Enabler","wolfram","1"
|
"Command Enabler","wolfram","1"
|
||||||
|
|||||||
|
Binary file not shown.
@@ -27,14 +27,23 @@ public class CommandTradeBeans extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
int beans = 0;
|
int beans = 0;
|
||||||
try {
|
|
||||||
|
try
|
||||||
|
{
|
||||||
beans = Integer.parseInt(input.args.split(" ")[0]);
|
beans = Integer.parseInt(input.args.split(" ")[0]);
|
||||||
}
|
}
|
||||||
catch (NumberFormatException e)
|
catch (NumberFormatException e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
beans = Integer.parseInt(input.args.split(" ")[1]);
|
||||||
|
}
|
||||||
|
catch(Exception eInner)
|
||||||
{
|
{
|
||||||
res.send(LocStrings.stub("TradeBeansIntParseError"));
|
res.send(LocStrings.stub("TradeBeansIntParseError"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(user.getBeans() < beans)
|
if(user.getBeans() < beans)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class CommandManager
|
|||||||
this.register(LocCommands.stub("music"), new CommandMusicMain(KittyRole.General, KittyRating.Safe));
|
this.register(LocCommands.stub("music"), new CommandMusicMain(KittyRole.General, KittyRating.Safe));
|
||||||
this.register(LocCommands.stub("defaultdance"), new CommandDefaultDance(KittyRole.General, KittyRating.Safe));
|
this.register(LocCommands.stub("defaultdance"), new CommandDefaultDance(KittyRole.General, KittyRating.Safe));
|
||||||
this.register(LocCommands.stub("getsauce"), new CommandGetSauce(KittyRole.General, KittyRating.Safe));
|
this.register(LocCommands.stub("getsauce"), new CommandGetSauce(KittyRole.General, KittyRating.Safe));
|
||||||
this.register(LocCommands.stub("tradebeans"), new CommandTradeBeans(KittyRole.General, KittyRating.Safe));
|
this.register(LocCommands.stub("tradebeans, trade"), new CommandTradeBeans(KittyRole.General, KittyRating.Safe));
|
||||||
|
|
||||||
this.register(LocCommands.stub("e6"), new CommandE6(KittyRole.General, KittyRating.Filtered));
|
this.register(LocCommands.stub("e6"), new CommandE6(KittyRole.General, KittyRating.Filtered));
|
||||||
this.register(LocCommands.stub("derpi"), new CommandDerpi(KittyRole.General, KittyRating.Filtered));
|
this.register(LocCommands.stub("derpi"), new CommandDerpi(KittyRole.General, KittyRating.Filtered));
|
||||||
|
|||||||
@@ -75,7 +75,21 @@ public class NetworkTheColorAPI
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
hex = hex.replace("#", "");
|
hex = hex.replace("#", "").trim();
|
||||||
|
String hexUpper = hex.toUpperCase();
|
||||||
|
|
||||||
|
// Verify the number is hex.
|
||||||
|
for(int i = 0; i < hexUpper.length(); ++i)
|
||||||
|
{
|
||||||
|
char current = hexUpper.charAt(i);
|
||||||
|
Boolean isValidNum = current >= '0' && current <= '9';
|
||||||
|
Boolean isValidChar = current >= 'A' && current <= 'F';
|
||||||
|
|
||||||
|
// If it's not a valid character or a valid number, return null/
|
||||||
|
if(!isValidNum && !isValidChar)
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
String response = HTTPUtils.sendGETRequest("https://www.thecolorapi.com/id?hex=" + hex);
|
String response = HTTPUtils.sendGETRequest("https://www.thecolorapi.com/id?hex=" + hex);
|
||||||
|
|
||||||
ColorData data = jsonParser.fromJson(response, ColorData.class);
|
ColorData data = jsonParser.fromJson(response, ColorData.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user