= Updated response method naming and formatting
This commit is contained in:
@@ -15,7 +15,7 @@ public class CommandBeansShow extends Command
|
|||||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
{
|
{
|
||||||
if(input.mentions == null)
|
if(input.mentions == null)
|
||||||
res.call(String.format(LocStrings.stub("BeansShowDisplay"), user.GetBeans()));
|
res.send(String.format(LocStrings.stub("BeansShowDisplay"), user.GetBeans()));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
String mentionedBeans = "";
|
String mentionedBeans = "";
|
||||||
@@ -23,7 +23,7 @@ public class CommandBeansShow extends Command
|
|||||||
{
|
{
|
||||||
mentionedBeans += mentioned.name + " has " + mentioned.GetBeans() + " ";
|
mentionedBeans += mentioned.name + " has " + mentioned.GetBeans() + " ";
|
||||||
}
|
}
|
||||||
res.call(String.format(LocStrings.stub("BeansShowMentioned"), mentionedBeans));
|
res.send(String.format(LocStrings.stub("BeansShowMentioned"), mentionedBeans));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class CommandBenchmark extends Command
|
|||||||
if(input.args == null || input.args.length() == 0)
|
if(input.args == null || input.args.length() == 0)
|
||||||
{
|
{
|
||||||
String output = getHelpText();
|
String output = getHelpText();
|
||||||
res.call(output);
|
res.send(output);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ public class CommandBenchmark extends Command
|
|||||||
|
|
||||||
if(commandOutput == null)
|
if(commandOutput == null)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("BenchmarkInvalid"));
|
res.send(LocStrings.stub("BenchmarkInvalid"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,19 +24,19 @@ public class CommandBetBeans extends Command
|
|||||||
bet = Integer.parseInt(input.args);
|
bet = Integer.parseInt(input.args);
|
||||||
if(bet < 50)
|
if(bet < 50)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("BetBeansLowBet"));
|
res.send(LocStrings.stub("BetBeansLowBet"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (NumberFormatException e)
|
catch (NumberFormatException e)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("BetBeansNotValid"));
|
res.send(LocStrings.stub("BetBeansNotValid"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(user.GetBeans() < bet)
|
if(user.GetBeans() < bet)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("BetBeansNotEnough"));
|
res.send(LocStrings.stub("BetBeansNotEnough"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,18 +47,18 @@ public class CommandBetBeans extends Command
|
|||||||
|
|
||||||
win = getWinning(slots);
|
win = getWinning(slots);
|
||||||
|
|
||||||
res.call(call);
|
res.send(call);
|
||||||
|
|
||||||
if(win == 0)
|
if(win == 0)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("BetBeansLose"));
|
res.send(LocStrings.stub("BetBeansLose"));
|
||||||
guild.beans.Add(bet);
|
guild.beans.Add(bet);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
user.ChangeBeans(bet*win);
|
user.ChangeBeans(bet*win);
|
||||||
guild.beans.Subtract(bet*win);
|
guild.beans.Subtract(bet*win);
|
||||||
res.call(String.format(LocStrings.stub("BetBeansWin"), "" + (bet*win)));
|
res.send(String.format(LocStrings.stub("BetBeansWin"), "" + (bet*win)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getWinning(int [] slots)
|
private int getWinning(int [] slots)
|
||||||
|
|||||||
@@ -20,6 +20,6 @@ public class CommandBetHistory extends Command
|
|||||||
@Override
|
@Override
|
||||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("BetHistoryOutput"), guild.beans.Get()));
|
res.send(String.format(LocStrings.stub("BetHistoryOutput"), guild.beans.Get()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ public class CommandBlurry extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
postProcessed = new File(name);
|
postProcessed = new File(name);
|
||||||
res.CallFile(postProcessed, "png");
|
res.sendFile(postProcessed, "png");
|
||||||
|
|
||||||
ImageUtils.BlockingFileDelete(preProcessed);
|
ImageUtils.BlockingFileDelete(preProcessed);
|
||||||
ImageUtils.BlockingFileDelete(postProcessed);
|
ImageUtils.BlockingFileDelete(postProcessed);
|
||||||
|
|||||||
@@ -69,14 +69,14 @@ public class CommandBoop extends Command
|
|||||||
if(input.mentions == null)
|
if(input.mentions == null)
|
||||||
{
|
{
|
||||||
boopTracker.ApplyBoop();
|
boopTracker.ApplyBoop();
|
||||||
res.call(String.format(LocStrings.stub("BoopStandard"), user.name, boopTracker.HowMany()));
|
res.send(String.format(LocStrings.stub("BoopStandard"), user.name, boopTracker.HowMany()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(input.mentions.length == 1)
|
if(input.mentions.length == 1)
|
||||||
{
|
{
|
||||||
boopTracker.ApplyBoop();
|
boopTracker.ApplyBoop();
|
||||||
res.call(String.format(LocStrings.stub("BoopPerson"), user.name, input.mentions[0].name));
|
res.send(String.format(LocStrings.stub("BoopPerson"), user.name, input.mentions[0].name));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ public class CommandBoop extends Command
|
|||||||
booped += "and " + input.mentions[i].name;
|
booped += "and " + input.mentions[i].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
res.call(String.format(LocStrings.stub("BoopMultiple"), user.name, booped));
|
res.send(String.format(LocStrings.stub("BoopMultiple"), user.name, booped));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ public class CommandCatch extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
catchFile = new File (name);
|
catchFile = new File (name);
|
||||||
res.CallFile(catchFile, "gif");
|
res.sendFile(catchFile, "gif");
|
||||||
|
|
||||||
// Thread cleanup...
|
// Thread cleanup...
|
||||||
ImageUtils.BlockingFileDelete(catchFile);
|
ImageUtils.BlockingFileDelete(catchFile);
|
||||||
|
|||||||
@@ -17,18 +17,18 @@ public class CommandChangeIndicator extends Command
|
|||||||
String arg = input.args.trim();
|
String arg = input.args.trim();
|
||||||
if(arg.length() == 0)
|
if(arg.length() == 0)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("ChangeIndicatorError"));
|
res.send(LocStrings.stub("ChangeIndicatorError"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String indicator = arg.substring(0, 1);
|
String indicator = arg.substring(0, 1);
|
||||||
if(indicator.charAt(0) == '\n' || indicator.charAt(0) == '\t' || indicator.charAt(0) == '\r')
|
if(indicator.charAt(0) == '\n' || indicator.charAt(0) == '\t' || indicator.charAt(0) == '\r')
|
||||||
{
|
{
|
||||||
res.call(LocStrings.Lookup("ChangeIndicatorError"));
|
res.send(LocStrings.Lookup("ChangeIndicatorError"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
guild.SetCommandIndicator(indicator);
|
guild.SetCommandIndicator(indicator);
|
||||||
res.call(String.format(LocStrings.stub("ChangeIndicatorChanged"), guild.GetCommandIndicator()));
|
res.send(String.format(LocStrings.stub("ChangeIndicatorChanged"), guild.GetCommandIndicator()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,14 +24,14 @@ public class CommandCharacterCreate extends Command
|
|||||||
String [] info = input.args.split(",");
|
String [] info = input.args.split(",");
|
||||||
if(info.length < 3)
|
if(info.length < 3)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("CharacterCreateNullInfo"));
|
res.send(LocStrings.stub("CharacterCreateNullInfo"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(CharacterManager.instance.addCharacter(user, info[0], info[1], info[2]))
|
if(CharacterManager.instance.addCharacter(user, info[0], info[1], info[2]))
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("CharacterCreateSuccess"));
|
res.send(LocStrings.stub("CharacterCreateSuccess"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
res.call(LocStrings.stub("CharacterCreateDuplicate"));
|
res.send(LocStrings.stub("CharacterCreateDuplicate"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,18 +21,18 @@ public class CommandCharacterEditBio extends Command
|
|||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("CharacterEditBioNotValid"));
|
res.send(LocStrings.stub("CharacterEditBioNotValid"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
KittyCharacter character = CharacterManager.instance.searchCharacter(input.args.split(" ")[0]).get(0);
|
KittyCharacter character = CharacterManager.instance.searchCharacter(input.args.split(" ")[0]).get(0);
|
||||||
if(character.getOwner().equals(user))
|
if(character.getOwner().equals(user))
|
||||||
{
|
{
|
||||||
CharacterManager.instance.editBio(character, input.args.substring(input.args.indexOf(' ')));
|
CharacterManager.instance.editBio(character, input.args.substring(input.args.indexOf(' ')));
|
||||||
res.call(LocStrings.stub("CharacterEditBioSuccess"));
|
res.send(LocStrings.stub("CharacterEditBioSuccess"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("CharacterEditBioNotAuth"));
|
res.send(LocStrings.stub("CharacterEditBioNotAuth"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,18 +21,18 @@ public class CommandCharacterEditName extends Command
|
|||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("CharacterEditNameNotValid"));
|
res.send(LocStrings.stub("CharacterEditNameNotValid"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
KittyCharacter character = CharacterManager.instance.searchCharacter(input.args.split(" ")[0]).get(0);
|
KittyCharacter character = CharacterManager.instance.searchCharacter(input.args.split(" ")[0]).get(0);
|
||||||
if(character.getOwner().equals(user))
|
if(character.getOwner().equals(user))
|
||||||
{
|
{
|
||||||
CharacterManager.instance.editName(character, input.args.substring(input.args.indexOf(' ')));
|
CharacterManager.instance.editName(character, input.args.substring(input.args.indexOf(' ')));
|
||||||
res.call(LocStrings.stub("CharacterEditNameSuccess"));
|
res.send(LocStrings.stub("CharacterEditNameSuccess"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("CharacterEditNameNotAuth"));
|
res.send(LocStrings.stub("CharacterEditNameNotAuth"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,18 +21,18 @@ public class CommandCharacterEditURL extends Command
|
|||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("CharacterEditURLNotValid"));
|
res.send(LocStrings.stub("CharacterEditURLNotValid"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
KittyCharacter character = CharacterManager.instance.searchCharacter(input.args.split(" ")[0]).get(0);
|
KittyCharacter character = CharacterManager.instance.searchCharacter(input.args.split(" ")[0]).get(0);
|
||||||
if(character.getOwner().equals(user))
|
if(character.getOwner().equals(user))
|
||||||
{
|
{
|
||||||
CharacterManager.instance.editRefImage(character, input.args.substring(input.args.indexOf(' ')));
|
CharacterManager.instance.editRefImage(character, input.args.substring(input.args.indexOf(' ')));
|
||||||
res.call(LocStrings.stub("CharacterEditURLSuccess"));
|
res.send(LocStrings.stub("CharacterEditURLSuccess"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("CharacterEditURLNotAuth"));
|
res.send(LocStrings.stub("CharacterEditURLNotAuth"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,21 +20,21 @@ public class CommandCharacterSearch extends Command
|
|||||||
ArrayList <KittyCharacter> characters = CharacterManager.instance.searchCharacter(input.args);
|
ArrayList <KittyCharacter> characters = CharacterManager.instance.searchCharacter(input.args);
|
||||||
if(characters.size() < 1)
|
if(characters.size() < 1)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("CharacterSearchNoCharacterFound"));
|
res.send(LocStrings.stub("CharacterSearchNoCharacterFound"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(characters.size() > 1)
|
if(characters.size() > 1)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("CharacterSearchMultipleCharacterHeader"));
|
res.send(LocStrings.stub("CharacterSearchMultipleCharacterHeader"));
|
||||||
for(KittyCharacter character:characters)
|
for(KittyCharacter character:characters)
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("CharacterSearchMultipleCharacter"), character.getName(), character.getOwner().name, character.getUID()));
|
res.send(String.format(LocStrings.stub("CharacterSearchMultipleCharacter"), character.getName(), character.getOwner().name, character.getUID()));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("CharacterSearchOneCharacter"), characters.get(0).getOwner().name, characters.get(0).getName(), characters.get(0).getBio(), characters.get(0).getRefImage(), characters.get(0).getUID()));
|
res.send(String.format(LocStrings.stub("CharacterSearchOneCharacter"), characters.get(0).getOwner().name, characters.get(0).getName(), characters.get(0).getBio(), characters.get(0).getRefImage(), characters.get(0).getUID()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@ public class CommandChoose extends Command
|
|||||||
{
|
{
|
||||||
if(input.args.trim().length() == 0)
|
if(input.args.trim().length() == 0)
|
||||||
{
|
{
|
||||||
res.call(Stats.instance.GetHelpText(input.key));
|
res.send(Stats.instance.GetHelpText(input.key));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,10 +29,10 @@ public class CommandChoose extends Command
|
|||||||
|
|
||||||
if(choices.length == 1)
|
if(choices.length == 1)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("ChooseOne"));
|
res.send(LocStrings.stub("ChooseOne"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
res.call(String.format(LocStrings.stub("ChooseChoice"), (choices[(int) (Math.random()*choices.length)]).toString()));
|
res.send(String.format(LocStrings.stub("ChooseChoice"), (choices[(int) (Math.random()*choices.length)]).toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ public class CommandColiru extends Command
|
|||||||
{
|
{
|
||||||
if(input.args.trim().length() < 1)
|
if(input.args.trim().length() < 1)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("ColiruError"));
|
res.send(LocStrings.stub("ColiruError"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
res.call(compiler.compileCPlus(input.args));
|
res.send(compiler.compileCPlus(input.args));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class CommandColor extends Command
|
|||||||
// Verify the color was even found
|
// Verify the color was even found
|
||||||
if(colorData == null)
|
if(colorData == null)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("ColorNotSearchable"));
|
res.send(LocStrings.stub("ColorNotSearchable"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ public class CommandColor extends Command
|
|||||||
response.footerText = "All percentages and values are rounded to the nearest whole number!" + (colorData.name.exact_match_name ? "" : " '" + colorData.name.value + "' is actually " + colorData.name.closest_named_hex + ".");
|
response.footerText = "All percentages and values are rounded to the nearest whole number!" + (colorData.name.exact_match_name ? "" : " '" + colorData.name.value + "' is actually " + colorData.name.closest_named_hex + ".");
|
||||||
|
|
||||||
// Send then delete the temp local files
|
// Send then delete the temp local files
|
||||||
res.callEmbed(response);
|
res.send(response);
|
||||||
ImageUtils.BlockingFileDelete(file);
|
ImageUtils.BlockingFileDelete(file);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class CommandCrouton extends Command
|
|||||||
|
|
||||||
embed.imageURL = "https://crouton.net/crouton.png";
|
embed.imageURL = "https://crouton.net/crouton.png";
|
||||||
|
|
||||||
res.callEmbed(embed);
|
res.send(embed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,6 @@ public class CommandDBFlush extends Command
|
|||||||
embed.descriptionText = "**Dirty:** " + numUpdated;
|
embed.descriptionText = "**Dirty:** " + numUpdated;
|
||||||
embed.color = Config.ColorDefault;
|
embed.color = Config.ColorDefault;
|
||||||
|
|
||||||
res.callEmbed(embed);
|
res.send(embed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,6 @@ public class CommandDBStats extends Command
|
|||||||
embed.descriptionText += "**Last Upkeep:** " + dateFormat.format(DatabaseManager.instance.getLastUpkeep()) + " UTC-7";
|
embed.descriptionText += "**Last Upkeep:** " + dateFormat.format(DatabaseManager.instance.getLastUpkeep()) + " UTC-7";
|
||||||
embed.color = Config.ColorDefault;
|
embed.color = Config.ColorDefault;
|
||||||
|
|
||||||
res.callEmbed(embed);
|
res.send(embed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,6 @@ public class CommandDoWork extends Command
|
|||||||
thispieceofshit += Math.log((double)i);
|
thispieceofshit += Math.log((double)i);
|
||||||
}
|
}
|
||||||
|
|
||||||
res.call(LocStrings.stub("DoWorkFinished"));
|
res.send(LocStrings.stub("DoWorkFinished"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,8 +41,8 @@ public class CommandEightBall extends Command
|
|||||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
{
|
{
|
||||||
if(input.args.trim().length() < 1)
|
if(input.args.trim().length() < 1)
|
||||||
res.call(LocStrings.stub("EightBallError"));
|
res.send(LocStrings.stub("EightBallError"));
|
||||||
|
|
||||||
res.call(answers[(int) (Math.random()*answers.length)]);
|
res.send(answers[(int) (Math.random()*answers.length)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,30 +27,30 @@ public class CommandFetch extends Command
|
|||||||
switch(num)
|
switch(num)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
res.call(String.format(LocStrings.stub("FetchBringBack"), emote));
|
res.send(String.format(LocStrings.stub("FetchBringBack"), emote));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
res.call(String.format(LocStrings.stub("FetchRunAway")));
|
res.send(String.format(LocStrings.stub("FetchRunAway")));
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
res.call(String.format(LocStrings.stub("FetchBringBackWrong"), guild.emoji.get((int)(Math.random() * guild.emoji.size()) + 1)));
|
res.send(String.format(LocStrings.stub("FetchBringBackWrong"), guild.emoji.get((int)(Math.random() * guild.emoji.size()) + 1)));
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
res.call(String.format(LocStrings.stub("FetchEat"), emote));
|
res.send(String.format(LocStrings.stub("FetchEat"), emote));
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
res.call(String.format(LocStrings.stub("FetchCatchRun"), emote));
|
res.send(String.format(LocStrings.stub("FetchCatchRun"), emote));
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
res.call(String.format(LocStrings.stub("FetchStare"), user.name));
|
res.send(String.format(LocStrings.stub("FetchStare"), user.name));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
res.call("" + num);
|
res.send("" + num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("FetchError")));
|
res.send(String.format(LocStrings.stub("FetchError")));
|
||||||
System.out.println(emote);
|
System.out.println(emote);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class CommandGiveBeans extends Command
|
|||||||
// First, make sure someone is mentioned
|
// First, make sure someone is mentioned
|
||||||
if(input.mentions == null)
|
if(input.mentions == null)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("GiveBeansNoneMentioned"));
|
res.send(LocStrings.stub("GiveBeansNoneMentioned"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ public class CommandGiveBeans extends Command
|
|||||||
// If there wasn't a number we could find, well, nothing we can do.
|
// If there wasn't a number we could find, well, nothing we can do.
|
||||||
if(beans == null)
|
if(beans == null)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("GiveBeansInvalid"));
|
res.send(LocStrings.stub("GiveBeansInvalid"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ public class CommandGiveBeans extends Command
|
|||||||
for(int i = 0; i < input.mentions.length; i++)
|
for(int i = 0; i < input.mentions.length; i++)
|
||||||
{
|
{
|
||||||
input.mentions[i].ChangeBeans(beans);
|
input.mentions[i].ChangeBeans(beans);
|
||||||
res.call(String.format(LocStrings.stub("GiveBeansSuccess"), input.mentions[i].name, "" + beans));
|
res.send(String.format(LocStrings.stub("GiveBeansSuccess"), input.mentions[i].name, "" + beans));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,16 +25,16 @@ public class CommandGuildRoleAdd extends Command
|
|||||||
{
|
{
|
||||||
if(guild.control.addRole(user.discordID, role))
|
if(guild.control.addRole(user.discordID, role))
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("GuildRoleAddSuccess"), role, user.name));
|
res.send(String.format(LocStrings.stub("GuildRoleAddSuccess"), role, user.name));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("GuildRoleAddFailure"), role, user.name));
|
res.send(String.format(LocStrings.stub("GuildRoleAddFailure"), role, user.name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("GuildRoleAddNotAllowed"), role));
|
res.send(String.format(LocStrings.stub("GuildRoleAddNotAllowed"), role));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,12 +27,12 @@ public class CommandGuildRoleAllowed extends Command
|
|||||||
role = roles[i].trim();
|
role = roles[i].trim();
|
||||||
if(guild.roleList.contains(role))
|
if(guild.roleList.contains(role))
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("GuildRoleAllowedDuplicate"));
|
res.send(LocStrings.stub("GuildRoleAllowedDuplicate"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
guild.roleList.add(role);
|
guild.roleList.add(role);
|
||||||
res.call(String.format(LocStrings.stub("GuildRoleAllowedSuccess"), role));
|
res.send(String.format(LocStrings.stub("GuildRoleAllowedSuccess"), role));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class CommandGuildRoleList extends Command
|
|||||||
String roles = "";
|
String roles = "";
|
||||||
if(guild.roleList.isEmpty())
|
if(guild.roleList.isEmpty())
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("GuildRoleListEmpty")));
|
res.send(String.format(LocStrings.stub("GuildRoleListEmpty")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for(int i = 0; i < guild.roleList.size(); i++)
|
for(int i = 0; i < guild.roleList.size(); i++)
|
||||||
@@ -26,6 +26,6 @@ public class CommandGuildRoleList extends Command
|
|||||||
roles += " and ";
|
roles += " and ";
|
||||||
roles += guild.roleList.get(i);
|
roles += guild.roleList.get(i);
|
||||||
}
|
}
|
||||||
res.call(String.format(LocStrings.stub("GuildRoleListOutput"), roles));
|
res.send(String.format(LocStrings.stub("GuildRoleListOutput"), roles));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,11 +28,11 @@ public class CommandGuildRoleNotAllowed extends Command
|
|||||||
if(guild.roleList.contains(role))
|
if(guild.roleList.contains(role))
|
||||||
{
|
{
|
||||||
guild.roleList.remove(role);
|
guild.roleList.remove(role);
|
||||||
res.call(LocStrings.stub("GuildRoleNotAllowedSuccess"));
|
res.send(LocStrings.stub("GuildRoleNotAllowedSuccess"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("GuildRoleNotAllowedFailure"), role));
|
res.send(String.format(LocStrings.stub("GuildRoleNotAllowedFailure"), role));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,16 +25,16 @@ public class CommandGuildRoleRemove extends Command
|
|||||||
{
|
{
|
||||||
if(guild.control.removeRole(user.discordID, role))
|
if(guild.control.removeRole(user.discordID, role))
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("GuildRoleRemoveSuccess"), role, user.name));
|
res.send(String.format(LocStrings.stub("GuildRoleRemoveSuccess"), role, user.name));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("GuildRoleRemoveFailure"), role, user.name));
|
res.send(String.format(LocStrings.stub("GuildRoleRemoveFailure"), role, user.name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("GuildRoleRemoveNotAllowed"), role));
|
res.send(String.format(LocStrings.stub("GuildRoleRemoveNotAllowed"), role));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ public class CommandHelp extends Command
|
|||||||
help = LocStrings.stub("HelpDisplay");
|
help = LocStrings.stub("HelpDisplay");
|
||||||
}
|
}
|
||||||
|
|
||||||
res.call(help);
|
res.send(help);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ public class CommandHelpBuilder extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
File file = new File(filename);
|
File file = new File(filename);
|
||||||
res.CallFile(file, "txt");
|
res.sendFile(file, "txt");
|
||||||
ImageUtils.BlockingFileDelete(file);
|
ImageUtils.BlockingFileDelete(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,6 @@ public class CommandInfo extends Command
|
|||||||
@Override
|
@Override
|
||||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("InfoResponse"));
|
res.send(LocStrings.stub("InfoResponse"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@ public class CommandInvite extends Command
|
|||||||
@Override
|
@Override
|
||||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
{
|
{
|
||||||
res.call("https://discordapp.com/oauth2/authorize?&client_id="+ Ref.CliID
|
res.send("https://discordapp.com/oauth2/authorize?&client_id="+ Ref.CliID
|
||||||
+"&scope=bot&permissions=8");
|
+"&scope=bot&permissions=8");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,10 +19,10 @@ public class CommandJDoodle extends Command
|
|||||||
{
|
{
|
||||||
if(input.args.trim().length() < 1)
|
if(input.args.trim().length() < 1)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("JDoodleError"));
|
res.send(LocStrings.stub("JDoodleError"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
res.call(compiler.compileJava(input.args));
|
res.send(compiler.compileJava(input.args));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,6 +94,6 @@ public class CommandLeaderboard extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Write out embed result
|
// Write out embed result
|
||||||
res.callEmbed(embed);
|
res.send(embed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class CommandMap extends Command
|
|||||||
}
|
}
|
||||||
catch(NumberFormatException e)
|
catch(NumberFormatException e)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("MapInvalid"));
|
res.send(LocStrings.stub("MapInvalid"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ public class CommandMap extends Command
|
|||||||
body += "\n```";
|
body += "\n```";
|
||||||
|
|
||||||
// Send back the map
|
// Send back the map
|
||||||
res.call(header + body);
|
res.send(header + body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verifies and appropriately caps input as necessary
|
// Verifies and appropriately caps input as necessary
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class CommandPerish extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
postProcessed = new File(name);
|
postProcessed = new File(name);
|
||||||
res.CallFile(postProcessed, "png");
|
res.sendFile(postProcessed, "png");
|
||||||
|
|
||||||
ImageUtils.BlockingFileDelete(preProcessed);
|
ImageUtils.BlockingFileDelete(preProcessed);
|
||||||
ImageUtils.BlockingFileDelete(postProcessed);
|
ImageUtils.BlockingFileDelete(postProcessed);
|
||||||
|
|||||||
@@ -21,6 +21,6 @@ public class CommandPing extends Command
|
|||||||
@Override
|
@Override
|
||||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("PingResponse"));
|
res.send(LocStrings.stub("PingResponse"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,15 +22,15 @@ public class CommandPollManage extends Command
|
|||||||
switch(input.args.split(" ")[0].toLowerCase())
|
switch(input.args.split(" ")[0].toLowerCase())
|
||||||
{
|
{
|
||||||
case "start":
|
case "start":
|
||||||
res.call(guild.startPoll(input.args.substring(input.args.indexOf(' ')).trim()));
|
res.send(guild.startPoll(input.args.substring(input.args.indexOf(' ')).trim()));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "choice":
|
case "choice":
|
||||||
res.call(guild.addChoiceToPoll(input.args.substring(input.args.indexOf(' ')).trim()));
|
res.send(guild.addChoiceToPoll(input.args.substring(input.args.indexOf(' ')).trim()));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "stop":
|
case "stop":
|
||||||
res.call(guild.endPoll());
|
res.send(guild.endPoll());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -31,6 +31,6 @@ public class CommandPollResults extends Command
|
|||||||
results += String.format(LocStrings.stub("PollResultsResponse"), votes.get(i).votes, votes.get(i).choice, (int)(((double)votes.get(i).votes) / ((double)totalVotes) * 100));
|
results += String.format(LocStrings.stub("PollResultsResponse"), votes.get(i).votes, votes.get(i).choice, (int)(((double)votes.get(i).votes) / ((double)totalVotes) * 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
res.call(results);
|
res.send(results);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class CommandPollShow extends Command
|
|||||||
{
|
{
|
||||||
if(!guild.polling)
|
if(!guild.polling)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("PollShowNoPoll"));
|
res.send(LocStrings.stub("PollShowNoPoll"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String poll = String.format(LocStrings.stub("PollShowPoll"), guild.poll);
|
String poll = String.format(LocStrings.stub("PollShowPoll"), guild.poll);
|
||||||
@@ -25,6 +25,6 @@ public class CommandPollShow extends Command
|
|||||||
poll += (i+1) + ": `" + guild.choices.get(i).choice + "`\n";
|
poll += (i+1) + ": `" + guild.choices.get(i).choice + "`\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
res.call(poll);
|
res.send(poll);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class CommandPollVote extends Command
|
|||||||
{
|
{
|
||||||
if(guild.hasVoted.contains(user.uniqueID))
|
if(guild.hasVoted.contains(user.uniqueID))
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("PollVoteAlreadyVoted"));
|
res.send(LocStrings.stub("PollVoteAlreadyVoted"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
@@ -25,23 +25,23 @@ public class CommandPollVote extends Command
|
|||||||
int voteNum = Integer.parseInt(input.args)-1;
|
int voteNum = Integer.parseInt(input.args)-1;
|
||||||
if(voteNum >= guild.choices.size() || voteNum < 0)
|
if(voteNum >= guild.choices.size() || voteNum < 0)
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("PollVoteNotValidVote"), voteNum));
|
res.send(String.format(LocStrings.stub("PollVoteNotValidVote"), voteNum));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KittyPoll polled = guild.choices.get(voteNum);
|
KittyPoll polled = guild.choices.get(voteNum);
|
||||||
polled.votes++;
|
polled.votes++;
|
||||||
guild.hasVoted.add(user.uniqueID);
|
guild.hasVoted.add(user.uniqueID);
|
||||||
res.call(LocStrings.stub("PollVoteSuccess") + " `" + polled.choice + "`!");
|
res.send(LocStrings.stub("PollVoteSuccess") + " `" + polled.choice + "`!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch (NumberFormatException e)
|
catch (NumberFormatException e)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("PollVoteNotValidNumber"));
|
res.send(LocStrings.stub("PollVoteNotValidNumber"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res.call(LocStrings.stub("PollVoteNoPoll"));
|
res.send(LocStrings.stub("PollVoteNoPoll"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ public class CommandRPEnd extends Command
|
|||||||
|
|
||||||
if(sending != null)
|
if(sending != null)
|
||||||
{
|
{
|
||||||
res.CallFile(sending, "txt");
|
res.sendFile(sending, "txt");
|
||||||
res.call(LocStrings.stub("RPEndFileOut"));
|
res.send(LocStrings.stub("RPEndFileOut"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("RPEndError"));
|
res.send(LocStrings.stub("RPEndError"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class CommandRPG extends Command
|
|||||||
if(input.args == null || input.args.length() == 0)
|
if(input.args == null || input.args.length() == 0)
|
||||||
{
|
{
|
||||||
String output = getHelpText();
|
String output = getHelpText();
|
||||||
res.call(output);
|
res.send(output);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,10 +44,10 @@ public class CommandRPG extends Command
|
|||||||
|
|
||||||
if(result == null)
|
if(result == null)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("RPGInvalid"));
|
res.send(LocStrings.stub("RPGInvalid"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
res.call(result);
|
res.send(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,6 @@ public class CommandRPStart extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res.call(RPManager.instance.newRP(channel, users));
|
res.send(RPManager.instance.newRP(channel, users));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ public class CommandRaffleEnd extends Command
|
|||||||
{
|
{
|
||||||
if(guild.endRaffle())
|
if(guild.endRaffle())
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("RaffleEndSuccess"));
|
res.send(LocStrings.stub("RaffleEndSuccess"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("RaffleEndFailure"));
|
res.send(LocStrings.stub("RaffleEndFailure"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,11 +22,11 @@ public class CommandRaffleJoin extends Command
|
|||||||
{
|
{
|
||||||
if(guild.joinRaffle(user))
|
if(guild.joinRaffle(user))
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("RaffleJoinSuccess"));
|
res.send(LocStrings.stub("RaffleJoinSuccess"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("RaffleJoinFailure"));
|
res.send(LocStrings.stub("RaffleJoinFailure"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ public class CommandRaffleSpin extends Command
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("RaffleSpinSuccess"), guild.chooseRaffleWinner().name));
|
res.send(String.format(LocStrings.stub("RaffleSpinSuccess"), guild.chooseRaffleWinner().name));
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("RaffleSpinFailure"));
|
res.send(LocStrings.stub("RaffleSpinFailure"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,11 +33,11 @@ public class CommandRaffleStart extends Command
|
|||||||
|
|
||||||
if(guild.startRaffle(beanCost))
|
if(guild.startRaffle(beanCost))
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("RaffleStartSuccess"), beanCost));
|
res.send(String.format(LocStrings.stub("RaffleStartSuccess"), beanCost));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("RaffleStartFailure"));
|
res.send(LocStrings.stub("RaffleStartFailure"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,11 +55,11 @@ public class CommandRating extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(newRating != null)
|
if(newRating != null)
|
||||||
res.call(LocStrings.stub("RatingChanged") + " " + newRating);
|
res.send(LocStrings.stub("RatingChanged") + " " + newRating);
|
||||||
else
|
else
|
||||||
res.call(LocStrings.stub("RatingInvalid") + " `" + input.args + "`");
|
res.send(LocStrings.stub("RatingInvalid") + " `" + input.args + "`");
|
||||||
|
|
||||||
if(newRating.equals("Filtered"))
|
if(newRating.equals("Filtered"))
|
||||||
res.call(LocStrings.stub("RatingWarning"));
|
res.send(LocStrings.stub("RatingWarning"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,13 +16,13 @@ public class CommandRole extends Command
|
|||||||
{
|
{
|
||||||
if(input.args.isEmpty())
|
if(input.args.isEmpty())
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("RoleStandardResponse") + " " + user.GetRole().name() + "!");
|
res.send(LocStrings.stub("RoleStandardResponse") + " " + user.GetRole().name() + "!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(user.GetRole().getValue() < KittyRole.Admin.getValue())
|
if(user.GetRole().getValue() < KittyRole.Admin.getValue())
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("RoleError"), KittyRole.Admin.toString()));
|
res.send(String.format(LocStrings.stub("RoleError"), KittyRole.Admin.toString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ public class CommandRole extends Command
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
res.call(LocStrings.stub("RoleNeededRole"));
|
res.send(LocStrings.stub("RoleNeededRole"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String users = "";
|
String users = "";
|
||||||
@@ -56,6 +56,6 @@ public class CommandRole extends Command
|
|||||||
users += input.mentions[i].name + " ";
|
users += input.mentions[i].name + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
res.call(String.format(LocStrings.stub("RoleChanged"), users, newRole.name()));
|
res.send(String.format(LocStrings.stub("RoleChanged"), users, newRole.name()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ public class CommandRoll extends Command
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
res.call(rollDice(input.args));
|
res.send(rollDice(input.args));
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("RollError"));
|
res.send(LocStrings.stub("RollError"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class CommandShutdown extends Command
|
|||||||
if(isSafe)
|
if(isSafe)
|
||||||
{
|
{
|
||||||
// Force upkeep, this works so long as upkeep is on the main thread.
|
// Force upkeep, this works so long as upkeep is on the main thread.
|
||||||
res.CallImmediate(LocStrings.stub("ShutdownSafe"));
|
res.sendImmediate(LocStrings.stub("ShutdownSafe"));
|
||||||
DatabaseManager.instance.upkeep();
|
DatabaseManager.instance.upkeep();
|
||||||
GlobalLog.Warn(LogFilter.Command, LocStrings.Lookup("ShutdownSafe"));
|
GlobalLog.Warn(LogFilter.Command, LocStrings.Lookup("ShutdownSafe"));
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ public class CommandShutdown extends Command
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.CallImmediate(LocStrings.stub("ShutdownUnsafe"));// "``");
|
res.sendImmediate(LocStrings.stub("ShutdownUnsafe"));// "``");
|
||||||
GlobalLog.Warn(LogFilter.Command, LocStrings.Lookup("ShutdownSafe"));
|
GlobalLog.Warn(LogFilter.Command, LocStrings.Lookup("ShutdownSafe"));
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class CommandStark extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
postProcessed = new File(name);
|
postProcessed = new File(name);
|
||||||
res.CallFile(postProcessed, "png");
|
res.sendFile(postProcessed, "png");
|
||||||
|
|
||||||
ImageUtils.BlockingFileDelete(preProcessed);
|
ImageUtils.BlockingFileDelete(preProcessed);
|
||||||
ImageUtils.BlockingFileDelete(postProcessed);
|
ImageUtils.BlockingFileDelete(postProcessed);
|
||||||
|
|||||||
@@ -66,6 +66,11 @@ public class CommandStats extends Command
|
|||||||
+ " Cached Users: " + userCount;
|
+ " Cached Users: " + userCount;
|
||||||
out += "\n```";
|
out += "\n```";
|
||||||
|
|
||||||
res.call(out);
|
KittyEmbed embed = new KittyEmbed();
|
||||||
|
embed.title = "Bot Stats";
|
||||||
|
embed.descriptionText = out;
|
||||||
|
embed.color = Config.ColorDefault;
|
||||||
|
|
||||||
|
res.send(embed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class CommandTeey extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
teeyFile = new File (name);
|
teeyFile = new File (name);
|
||||||
res.CallFile(teeyFile, "gif");
|
res.sendFile(teeyFile, "gif");
|
||||||
|
|
||||||
// Thread cleanup...
|
// Thread cleanup...
|
||||||
ImageUtils.BlockingFileDelete(teeyFile);
|
ImageUtils.BlockingFileDelete(teeyFile);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class CommandTradeBeans extends Command
|
|||||||
{
|
{
|
||||||
if(input.mentions == null)
|
if(input.mentions == null)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("TradeBeansNoTargetError"));
|
res.send(LocStrings.stub("TradeBeansNoTargetError"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,25 +32,25 @@ public class CommandTradeBeans extends Command
|
|||||||
}
|
}
|
||||||
catch (NumberFormatException e)
|
catch (NumberFormatException e)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("TradeBeansIntParseError"));
|
res.send(LocStrings.stub("TradeBeansIntParseError"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(user.GetBeans() < beans)
|
if(user.GetBeans() < beans)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("TradeBeansNotEnoughError"));
|
res.send(LocStrings.stub("TradeBeansNotEnoughError"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(beans < 0)
|
if(beans < 0)
|
||||||
{
|
{
|
||||||
res.call(String.format(LocStrings.stub("TradeBeansStealingBeans"), user.name));
|
res.send(String.format(LocStrings.stub("TradeBeansStealingBeans"), user.name));
|
||||||
user.ChangeBeans(-10);
|
user.ChangeBeans(-10);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
input.mentions[0].ChangeBeans(beans);
|
input.mentions[0].ChangeBeans(beans);
|
||||||
user.ChangeBeans(-beans);
|
user.ChangeBeans(-beans);
|
||||||
res.call(String.format(LocStrings.stub("TradeBeansSuccess"), user.name, input.mentions[0].name, beans));
|
res.send(String.format(LocStrings.stub("TradeBeansSuccess"), user.name, input.mentions[0].name, beans));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ public class CommandTweet extends Command
|
|||||||
{
|
{
|
||||||
//TODO: Figure out how to pass pictures correctly
|
//TODO: Figure out how to pass pictures correctly
|
||||||
try {
|
try {
|
||||||
res.call(tweet.tweet(input.args));
|
res.send(tweet.tweet(input.args));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
res.call(LocStrings.stub("TweetError"));
|
res.send(LocStrings.stub("TweetError"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,17 +21,17 @@ public class CommandWolfram extends Command
|
|||||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
{
|
{
|
||||||
if(input.args == null || input.args.trim().length() == 0)
|
if(input.args == null || input.args.trim().length() == 0)
|
||||||
res.call(LocStrings.stub("WolframNoArgs"));
|
res.send(LocStrings.stub("WolframNoArgs"));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
File pic = new File(searcher.getWolfram(input.args));
|
File pic = new File(searcher.getWolfram(input.args));
|
||||||
res.CallFile(pic, "png");
|
res.sendFile(pic, "png");
|
||||||
ImageUtils.BlockingFileDelete(pic);
|
ImageUtils.BlockingFileDelete(pic);
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
res.call(LocStrings.stub("WolframError"));
|
res.send(LocStrings.stub("WolframError"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ public class CommandYeet extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
yeetFile = new File (name);
|
yeetFile = new File (name);
|
||||||
res.CallFile(yeetFile, "gif");
|
res.sendFile(yeetFile, "gif");
|
||||||
|
|
||||||
// Thread cleanup...
|
// Thread cleanup...
|
||||||
ImageUtils.BlockingFileDelete(yeetFile);
|
ImageUtils.BlockingFileDelete(yeetFile);
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class RPManager
|
|||||||
{
|
{
|
||||||
reminder += " <@" + users.get(i) + ">";
|
reminder += " <@" + users.get(i) + ">";
|
||||||
}
|
}
|
||||||
res.CallToChannel(reminder, entry.getValue().getChannel().uniqueID);
|
res.sendToChannel(reminder, entry.getValue().getChannel().uniqueID);
|
||||||
reminder = "";
|
reminder = "";
|
||||||
|
|
||||||
entry.getValue().resetTimer();
|
entry.getValue().resetTimer();
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ public class BenchmarkFormattable
|
|||||||
public void call(Response res)
|
public void call(Response res)
|
||||||
{
|
{
|
||||||
if(resEmbed == null)
|
if(resEmbed == null)
|
||||||
res.call(resString);
|
res.send(resString);
|
||||||
else
|
else
|
||||||
res.callEmbed(resEmbed);
|
res.send(resEmbed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class Response
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Builds a nicely formatted embedded message based on information provided
|
// Builds a nicely formatted embedded message based on information provided
|
||||||
public void callEmbed(KittyEmbed embedInfo)
|
public void send(KittyEmbed embedInfo)
|
||||||
{
|
{
|
||||||
EmbedBuilder embed = new EmbedBuilder();
|
EmbedBuilder embed = new EmbedBuilder();
|
||||||
|
|
||||||
@@ -83,13 +83,12 @@ public class Response
|
|||||||
if(embedInfo.thumbnailURL != null)
|
if(embedInfo.thumbnailURL != null)
|
||||||
embed.setThumbnail(embedInfo.thumbnailURL);
|
embed.setThumbnail(embedInfo.thumbnailURL);
|
||||||
|
|
||||||
event.getChannel().sendMessage(embed.build());
|
event.getChannel().sendMessage(embed.build()).queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Queues a standard text-based message response to the channel that issued the command.
|
// Queues a standard text-based message response to the channel that issued the command.
|
||||||
public void call(String toRespondWith)
|
public void send(String toRespondWith)
|
||||||
{
|
{
|
||||||
GlobalLog.Log(LogFilter.Response, "Sending response: " + toRespondWith);
|
GlobalLog.Log(LogFilter.Response, "Sending response: " + toRespondWith);
|
||||||
if(toRespondWith.length() > discordMessageMax)
|
if(toRespondWith.length() > discordMessageMax)
|
||||||
@@ -103,7 +102,7 @@ public class Response
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Queues a standard text-based message response to the specified channel.
|
// Queues a standard text-based message response to the specified channel.
|
||||||
public void CallToChannel(String toRespondWith, String channelID)
|
public void sendToChannel(String toRespondWith, String channelID)
|
||||||
{
|
{
|
||||||
TextChannel channel;
|
TextChannel channel;
|
||||||
channel = kitty.getTextChannelById(Long.parseLong(channelID));
|
channel = kitty.getTextChannelById(Long.parseLong(channelID));
|
||||||
@@ -118,7 +117,7 @@ public class Response
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Immediately dispatches the message to the channel that issued the command.
|
// Immediately dispatches the message to the channel that issued the command.
|
||||||
public void CallImmediate(String toRespondWith)
|
public void sendImmediate(String toRespondWith)
|
||||||
{
|
{
|
||||||
GlobalLog.Log(LogFilter.Response, "Sending immediate response: " + toRespondWith);
|
GlobalLog.Log(LogFilter.Response, "Sending immediate response: " + toRespondWith);
|
||||||
if(toRespondWith.length() > discordMessageMax)
|
if(toRespondWith.length() > discordMessageMax)
|
||||||
@@ -132,14 +131,14 @@ public class Response
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Queues a file response to the channel that issued the command.
|
// Queues a file response to the channel that issued the command.
|
||||||
public void CallFile(File toRespondWith, String extension)
|
public void sendFile(File toRespondWith, String extension)
|
||||||
{
|
{
|
||||||
GlobalLog.Log(LogFilter.Response, "Sending file response");
|
GlobalLog.Log(LogFilter.Response, "Sending file response");
|
||||||
event.getChannel().sendFile(toRespondWith, "return." + extension).queue();
|
event.getChannel().sendFile(toRespondWith, "return." + extension).queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Queues an input stream response to the channel that issued the command.
|
// Queues an input stream response to the channel that issued the command.
|
||||||
public void CallInput(InputStream in, String extension)
|
public void sendFile(InputStream in, String extension)
|
||||||
{
|
{
|
||||||
GlobalLog.Log(LogFilter.Response, "Sending input stream response");
|
GlobalLog.Log(LogFilter.Response, "Sending input stream response");
|
||||||
event.getChannel().sendFile(in, "return." + extension).queue();
|
event.getChannel().sendFile(in, "return." + extension).queue();
|
||||||
|
|||||||
+1
-1
@@ -106,7 +106,7 @@ public class Main extends ListenerAdapter
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
response.call(pluginOutput.get(i));
|
response.send(pluginOutput.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user