From b0292666c0bb3645e260b743f1fe9ae0cb0177f7 Mon Sep 17 00:00:00 2001 From: Matthew Cech Date: Wed, 19 Jun 2019 21:16:51 -0700 Subject: [PATCH] = Updated response method naming and formatting --- src/commands/CommandBeansShow.java | 4 ++-- src/commands/CommandBenchmark.java | 4 ++-- src/commands/CommandBetBeans.java | 12 ++++++------ src/commands/CommandBetHistory.java | 2 +- src/commands/CommandBlurry.java | 2 +- src/commands/CommandBoop.java | 6 +++--- src/commands/CommandCatch.java | 2 +- src/commands/CommandChangeIndicator.java | 6 +++--- src/commands/CommandCharacterCreate.java | 6 +++--- src/commands/CommandCharacterEditBio.java | 6 +++--- src/commands/CommandCharacterEditName.java | 6 +++--- src/commands/CommandCharacterEditURL.java | 6 +++--- src/commands/CommandCharacterSearch.java | 8 ++++---- src/commands/CommandChoose.java | 6 +++--- src/commands/CommandColiru.java | 4 ++-- src/commands/CommandColor.java | 4 ++-- src/commands/CommandCrouton.java | 2 +- src/commands/CommandDBFlush.java | 2 +- src/commands/CommandDBStats.java | 2 +- src/commands/CommandDoWork.java | 2 +- src/commands/CommandEightBall.java | 4 ++-- src/commands/CommandFetch.java | 16 ++++++++-------- src/commands/CommandGiveBeans.java | 6 +++--- src/commands/CommandGuildRoleAdd.java | 6 +++--- src/commands/CommandGuildRoleAllowed.java | 4 ++-- src/commands/CommandGuildRoleList.java | 4 ++-- src/commands/CommandGuildRoleNotAllowed.java | 4 ++-- src/commands/CommandGuildRoleRemove.java | 6 +++--- src/commands/CommandHelp.java | 2 +- src/commands/CommandHelpBuilder.java | 2 +- src/commands/CommandInfo.java | 2 +- src/commands/CommandInvite.java | 2 +- src/commands/CommandJDoodle.java | 4 ++-- src/commands/CommandLeaderboard.java | 2 +- src/commands/CommandMap.java | 4 ++-- src/commands/CommandPerish.java | 2 +- src/commands/CommandPing.java | 2 +- src/commands/CommandPollManage.java | 6 +++--- src/commands/CommandPollResults.java | 2 +- src/commands/CommandPollShow.java | 4 ++-- src/commands/CommandPollVote.java | 10 +++++----- src/commands/CommandRPEnd.java | 6 +++--- src/commands/CommandRPG.java | 6 +++--- src/commands/CommandRPStart.java | 2 +- src/commands/CommandRaffleEnd.java | 4 ++-- src/commands/CommandRaffleJoin.java | 4 ++-- src/commands/CommandRaffleSpin.java | 4 ++-- src/commands/CommandRaffleStart.java | 4 ++-- src/commands/CommandRating.java | 6 +++--- src/commands/CommandRole.java | 8 ++++---- src/commands/CommandRoll.java | 4 ++-- src/commands/CommandShutdown.java | 4 ++-- src/commands/CommandStark.java | 2 +- src/commands/CommandStats.java | 7 ++++++- src/commands/CommandTeey.java | 2 +- src/commands/CommandTradeBeans.java | 10 +++++----- src/commands/CommandTweet.java | 4 ++-- src/commands/CommandWolfram.java | 6 +++--- src/commands/CommandYeet.java | 2 +- src/core/RPManager.java | 2 +- src/core/benchmark/BenchmarkFormattable.java | 4 ++-- src/dataStructures/Response.java | 15 +++++++-------- src/main/Main.java | 2 +- 63 files changed, 149 insertions(+), 145 deletions(-) diff --git a/src/commands/CommandBeansShow.java b/src/commands/CommandBeansShow.java index 08db78f..29145b2 100644 --- a/src/commands/CommandBeansShow.java +++ b/src/commands/CommandBeansShow.java @@ -15,7 +15,7 @@ public class CommandBeansShow extends Command public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res) { if(input.mentions == null) - res.call(String.format(LocStrings.stub("BeansShowDisplay"), user.GetBeans())); + res.send(String.format(LocStrings.stub("BeansShowDisplay"), user.GetBeans())); else { String mentionedBeans = ""; @@ -23,7 +23,7 @@ public class CommandBeansShow extends Command { mentionedBeans += mentioned.name + " has " + mentioned.GetBeans() + " "; } - res.call(String.format(LocStrings.stub("BeansShowMentioned"), mentionedBeans)); + res.send(String.format(LocStrings.stub("BeansShowMentioned"), mentionedBeans)); } } } diff --git a/src/commands/CommandBenchmark.java b/src/commands/CommandBenchmark.java index bdfaa03..bd66977 100644 --- a/src/commands/CommandBenchmark.java +++ b/src/commands/CommandBenchmark.java @@ -35,7 +35,7 @@ public class CommandBenchmark extends Command if(input.args == null || input.args.length() == 0) { String output = getHelpText(); - res.call(output); + res.send(output); return; } @@ -47,7 +47,7 @@ public class CommandBenchmark extends Command if(commandOutput == null) { - res.call(LocStrings.stub("BenchmarkInvalid")); + res.send(LocStrings.stub("BenchmarkInvalid")); return; } diff --git a/src/commands/CommandBetBeans.java b/src/commands/CommandBetBeans.java index e8440af..c826c78 100644 --- a/src/commands/CommandBetBeans.java +++ b/src/commands/CommandBetBeans.java @@ -24,19 +24,19 @@ public class CommandBetBeans extends Command bet = Integer.parseInt(input.args); if(bet < 50) { - res.call(LocStrings.stub("BetBeansLowBet")); + res.send(LocStrings.stub("BetBeansLowBet")); return; } } catch (NumberFormatException e) { - res.call(LocStrings.stub("BetBeansNotValid")); + res.send(LocStrings.stub("BetBeansNotValid")); return; } if(user.GetBeans() < bet) { - res.call(LocStrings.stub("BetBeansNotEnough")); + res.send(LocStrings.stub("BetBeansNotEnough")); return; } @@ -47,18 +47,18 @@ public class CommandBetBeans extends Command win = getWinning(slots); - res.call(call); + res.send(call); if(win == 0) { - res.call(LocStrings.stub("BetBeansLose")); + res.send(LocStrings.stub("BetBeansLose")); guild.beans.Add(bet); return; } user.ChangeBeans(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) diff --git a/src/commands/CommandBetHistory.java b/src/commands/CommandBetHistory.java index 700e26e..3d351f9 100644 --- a/src/commands/CommandBetHistory.java +++ b/src/commands/CommandBetHistory.java @@ -20,6 +20,6 @@ public class CommandBetHistory extends Command @Override 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())); } } \ No newline at end of file diff --git a/src/commands/CommandBlurry.java b/src/commands/CommandBlurry.java index 1e5e983..ff56a5b 100644 --- a/src/commands/CommandBlurry.java +++ b/src/commands/CommandBlurry.java @@ -61,7 +61,7 @@ public class CommandBlurry extends Command } postProcessed = new File(name); - res.CallFile(postProcessed, "png"); + res.sendFile(postProcessed, "png"); ImageUtils.BlockingFileDelete(preProcessed); ImageUtils.BlockingFileDelete(postProcessed); diff --git a/src/commands/CommandBoop.java b/src/commands/CommandBoop.java index 7abc488..5ab3ef2 100644 --- a/src/commands/CommandBoop.java +++ b/src/commands/CommandBoop.java @@ -69,14 +69,14 @@ public class CommandBoop extends Command if(input.mentions == null) { 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 { if(input.mentions.length == 1) { 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; } @@ -90,7 +90,7 @@ public class CommandBoop extends Command 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)); } } } \ No newline at end of file diff --git a/src/commands/CommandCatch.java b/src/commands/CommandCatch.java index 31f4b57..dd24612 100644 --- a/src/commands/CommandCatch.java +++ b/src/commands/CommandCatch.java @@ -62,7 +62,7 @@ public class CommandCatch extends Command } catchFile = new File (name); - res.CallFile(catchFile, "gif"); + res.sendFile(catchFile, "gif"); // Thread cleanup... ImageUtils.BlockingFileDelete(catchFile); diff --git a/src/commands/CommandChangeIndicator.java b/src/commands/CommandChangeIndicator.java index c8786d6..415f5df 100644 --- a/src/commands/CommandChangeIndicator.java +++ b/src/commands/CommandChangeIndicator.java @@ -17,18 +17,18 @@ public class CommandChangeIndicator extends Command String arg = input.args.trim(); if(arg.length() == 0) { - res.call(LocStrings.stub("ChangeIndicatorError")); + res.send(LocStrings.stub("ChangeIndicatorError")); return; } String indicator = arg.substring(0, 1); if(indicator.charAt(0) == '\n' || indicator.charAt(0) == '\t' || indicator.charAt(0) == '\r') { - res.call(LocStrings.Lookup("ChangeIndicatorError")); + res.send(LocStrings.Lookup("ChangeIndicatorError")); return; } guild.SetCommandIndicator(indicator); - res.call(String.format(LocStrings.stub("ChangeIndicatorChanged"), guild.GetCommandIndicator())); + res.send(String.format(LocStrings.stub("ChangeIndicatorChanged"), guild.GetCommandIndicator())); } } diff --git a/src/commands/CommandCharacterCreate.java b/src/commands/CommandCharacterCreate.java index 53b0165..0933ed8 100644 --- a/src/commands/CommandCharacterCreate.java +++ b/src/commands/CommandCharacterCreate.java @@ -24,14 +24,14 @@ public class CommandCharacterCreate extends Command String [] info = input.args.split(","); if(info.length < 3) { - res.call(LocStrings.stub("CharacterCreateNullInfo")); + res.send(LocStrings.stub("CharacterCreateNullInfo")); return; } if(CharacterManager.instance.addCharacter(user, info[0], info[1], info[2])) { - res.call(LocStrings.stub("CharacterCreateSuccess")); + res.send(LocStrings.stub("CharacterCreateSuccess")); return; } - res.call(LocStrings.stub("CharacterCreateDuplicate")); + res.send(LocStrings.stub("CharacterCreateDuplicate")); } } \ No newline at end of file diff --git a/src/commands/CommandCharacterEditBio.java b/src/commands/CommandCharacterEditBio.java index f22c420..4d42579 100644 --- a/src/commands/CommandCharacterEditBio.java +++ b/src/commands/CommandCharacterEditBio.java @@ -21,18 +21,18 @@ public class CommandCharacterEditBio extends Command } catch(Exception e) { - res.call(LocStrings.stub("CharacterEditBioNotValid")); + res.send(LocStrings.stub("CharacterEditBioNotValid")); return; } KittyCharacter character = CharacterManager.instance.searchCharacter(input.args.split(" ")[0]).get(0); if(character.getOwner().equals(user)) { CharacterManager.instance.editBio(character, input.args.substring(input.args.indexOf(' '))); - res.call(LocStrings.stub("CharacterEditBioSuccess")); + res.send(LocStrings.stub("CharacterEditBioSuccess")); } else { - res.call(LocStrings.stub("CharacterEditBioNotAuth")); + res.send(LocStrings.stub("CharacterEditBioNotAuth")); } } } \ No newline at end of file diff --git a/src/commands/CommandCharacterEditName.java b/src/commands/CommandCharacterEditName.java index fcddca6..7382331 100644 --- a/src/commands/CommandCharacterEditName.java +++ b/src/commands/CommandCharacterEditName.java @@ -21,18 +21,18 @@ public class CommandCharacterEditName extends Command } catch(Exception e) { - res.call(LocStrings.stub("CharacterEditNameNotValid")); + res.send(LocStrings.stub("CharacterEditNameNotValid")); return; } KittyCharacter character = CharacterManager.instance.searchCharacter(input.args.split(" ")[0]).get(0); if(character.getOwner().equals(user)) { CharacterManager.instance.editName(character, input.args.substring(input.args.indexOf(' '))); - res.call(LocStrings.stub("CharacterEditNameSuccess")); + res.send(LocStrings.stub("CharacterEditNameSuccess")); } else { - res.call(LocStrings.stub("CharacterEditNameNotAuth")); + res.send(LocStrings.stub("CharacterEditNameNotAuth")); } } } \ No newline at end of file diff --git a/src/commands/CommandCharacterEditURL.java b/src/commands/CommandCharacterEditURL.java index cabfcbc..39a8c5c 100644 --- a/src/commands/CommandCharacterEditURL.java +++ b/src/commands/CommandCharacterEditURL.java @@ -21,18 +21,18 @@ public class CommandCharacterEditURL extends Command } catch(Exception e) { - res.call(LocStrings.stub("CharacterEditURLNotValid")); + res.send(LocStrings.stub("CharacterEditURLNotValid")); return; } KittyCharacter character = CharacterManager.instance.searchCharacter(input.args.split(" ")[0]).get(0); if(character.getOwner().equals(user)) { CharacterManager.instance.editRefImage(character, input.args.substring(input.args.indexOf(' '))); - res.call(LocStrings.stub("CharacterEditURLSuccess")); + res.send(LocStrings.stub("CharacterEditURLSuccess")); } else { - res.call(LocStrings.stub("CharacterEditURLNotAuth")); + res.send(LocStrings.stub("CharacterEditURLNotAuth")); } } } \ No newline at end of file diff --git a/src/commands/CommandCharacterSearch.java b/src/commands/CommandCharacterSearch.java index aaf3698..5cabef0 100644 --- a/src/commands/CommandCharacterSearch.java +++ b/src/commands/CommandCharacterSearch.java @@ -20,21 +20,21 @@ public class CommandCharacterSearch extends Command ArrayList characters = CharacterManager.instance.searchCharacter(input.args); if(characters.size() < 1) { - res.call(LocStrings.stub("CharacterSearchNoCharacterFound")); + res.send(LocStrings.stub("CharacterSearchNoCharacterFound")); return; } if(characters.size() > 1) { - res.call(LocStrings.stub("CharacterSearchMultipleCharacterHeader")); + res.send(LocStrings.stub("CharacterSearchMultipleCharacterHeader")); 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; } 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())); } } } \ No newline at end of file diff --git a/src/commands/CommandChoose.java b/src/commands/CommandChoose.java index fbcecb7..30893a7 100644 --- a/src/commands/CommandChoose.java +++ b/src/commands/CommandChoose.java @@ -21,7 +21,7 @@ public class CommandChoose extends Command { if(input.args.trim().length() == 0) { - res.call(Stats.instance.GetHelpText(input.key)); + res.send(Stats.instance.GetHelpText(input.key)); return; } @@ -29,10 +29,10 @@ public class CommandChoose extends Command if(choices.length == 1) { - res.call(LocStrings.stub("ChooseOne")); + res.send(LocStrings.stub("ChooseOne")); 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())); } } diff --git a/src/commands/CommandColiru.java b/src/commands/CommandColiru.java index 3091670..3973801 100644 --- a/src/commands/CommandColiru.java +++ b/src/commands/CommandColiru.java @@ -19,11 +19,11 @@ public class CommandColiru extends Command { if(input.args.trim().length() < 1) { - res.call(LocStrings.stub("ColiruError")); + res.send(LocStrings.stub("ColiruError")); return; } - res.call(compiler.compileCPlus(input.args)); + res.send(compiler.compileCPlus(input.args)); } } diff --git a/src/commands/CommandColor.java b/src/commands/CommandColor.java index fd19c89..a130c86 100644 --- a/src/commands/CommandColor.java +++ b/src/commands/CommandColor.java @@ -37,7 +37,7 @@ public class CommandColor extends Command // Verify the color was even found if(colorData == null) { - res.call(LocStrings.stub("ColorNotSearchable")); + res.send(LocStrings.stub("ColorNotSearchable")); 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 + "."); // Send then delete the temp local files - res.callEmbed(response); + res.send(response); ImageUtils.BlockingFileDelete(file); }; diff --git a/src/commands/CommandCrouton.java b/src/commands/CommandCrouton.java index 2ea8800..7552b87 100644 --- a/src/commands/CommandCrouton.java +++ b/src/commands/CommandCrouton.java @@ -34,7 +34,7 @@ public class CommandCrouton extends Command embed.imageURL = "https://crouton.net/crouton.png"; - res.callEmbed(embed); + res.send(embed); } } diff --git a/src/commands/CommandDBFlush.java b/src/commands/CommandDBFlush.java index 5c11278..982c0fa 100644 --- a/src/commands/CommandDBFlush.java +++ b/src/commands/CommandDBFlush.java @@ -30,6 +30,6 @@ public class CommandDBFlush extends Command embed.descriptionText = "**Dirty:** " + numUpdated; embed.color = Config.ColorDefault; - res.callEmbed(embed); + res.send(embed); } } diff --git a/src/commands/CommandDBStats.java b/src/commands/CommandDBStats.java index 448f923..de1fcd5 100644 --- a/src/commands/CommandDBStats.java +++ b/src/commands/CommandDBStats.java @@ -38,6 +38,6 @@ public class CommandDBStats extends Command embed.descriptionText += "**Last Upkeep:** " + dateFormat.format(DatabaseManager.instance.getLastUpkeep()) + " UTC-7"; embed.color = Config.ColorDefault; - res.callEmbed(embed); + res.send(embed); } } diff --git a/src/commands/CommandDoWork.java b/src/commands/CommandDoWork.java index 840a2d1..1cbc063 100644 --- a/src/commands/CommandDoWork.java +++ b/src/commands/CommandDoWork.java @@ -28,6 +28,6 @@ public class CommandDoWork extends Command thispieceofshit += Math.log((double)i); } - res.call(LocStrings.stub("DoWorkFinished")); + res.send(LocStrings.stub("DoWorkFinished")); } } \ No newline at end of file diff --git a/src/commands/CommandEightBall.java b/src/commands/CommandEightBall.java index 531e49c..2b97f79 100644 --- a/src/commands/CommandEightBall.java +++ b/src/commands/CommandEightBall.java @@ -41,8 +41,8 @@ public class CommandEightBall extends Command public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res) { 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)]); } } diff --git a/src/commands/CommandFetch.java b/src/commands/CommandFetch.java index 25fee6f..29c578a 100644 --- a/src/commands/CommandFetch.java +++ b/src/commands/CommandFetch.java @@ -27,30 +27,30 @@ public class CommandFetch extends Command switch(num) { case 1: - res.call(String.format(LocStrings.stub("FetchBringBack"), emote)); + res.send(String.format(LocStrings.stub("FetchBringBack"), emote)); break; case 2: - res.call(String.format(LocStrings.stub("FetchRunAway"))); + res.send(String.format(LocStrings.stub("FetchRunAway"))); break; 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; case 4: - res.call(String.format(LocStrings.stub("FetchEat"), emote)); + res.send(String.format(LocStrings.stub("FetchEat"), emote)); break; case 5: - res.call(String.format(LocStrings.stub("FetchCatchRun"), emote)); + res.send(String.format(LocStrings.stub("FetchCatchRun"), emote)); break; case 6: - res.call(String.format(LocStrings.stub("FetchStare"), user.name)); + res.send(String.format(LocStrings.stub("FetchStare"), user.name)); break; default: - res.call("" + num); + res.send("" + num); } } else { - res.call(String.format(LocStrings.stub("FetchError"))); + res.send(String.format(LocStrings.stub("FetchError"))); System.out.println(emote); } } diff --git a/src/commands/CommandGiveBeans.java b/src/commands/CommandGiveBeans.java index 32dd44c..bc50af4 100644 --- a/src/commands/CommandGiveBeans.java +++ b/src/commands/CommandGiveBeans.java @@ -17,7 +17,7 @@ public class CommandGiveBeans extends Command // First, make sure someone is mentioned if(input.mentions == null) { - res.call(LocStrings.stub("GiveBeansNoneMentioned")); + res.send(LocStrings.stub("GiveBeansNoneMentioned")); 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(beans == null) { - res.call(LocStrings.stub("GiveBeansInvalid")); + res.send(LocStrings.stub("GiveBeansInvalid")); return; } @@ -50,7 +50,7 @@ public class CommandGiveBeans extends Command for(int i = 0; i < input.mentions.length; i++) { 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)); } } } diff --git a/src/commands/CommandGuildRoleAdd.java b/src/commands/CommandGuildRoleAdd.java index 0943511..b4d212e 100644 --- a/src/commands/CommandGuildRoleAdd.java +++ b/src/commands/CommandGuildRoleAdd.java @@ -25,16 +25,16 @@ public class CommandGuildRoleAdd extends Command { 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 { - res.call(String.format(LocStrings.stub("GuildRoleAddFailure"), role, user.name)); + res.send(String.format(LocStrings.stub("GuildRoleAddFailure"), role, user.name)); } } else { - res.call(String.format(LocStrings.stub("GuildRoleAddNotAllowed"), role)); + res.send(String.format(LocStrings.stub("GuildRoleAddNotAllowed"), role)); } } } \ No newline at end of file diff --git a/src/commands/CommandGuildRoleAllowed.java b/src/commands/CommandGuildRoleAllowed.java index f8e7b29..cc40bb2 100644 --- a/src/commands/CommandGuildRoleAllowed.java +++ b/src/commands/CommandGuildRoleAllowed.java @@ -27,12 +27,12 @@ public class CommandGuildRoleAllowed extends Command role = roles[i].trim(); if(guild.roleList.contains(role)) { - res.call(LocStrings.stub("GuildRoleAllowedDuplicate")); + res.send(LocStrings.stub("GuildRoleAllowedDuplicate")); } else { guild.roleList.add(role); - res.call(String.format(LocStrings.stub("GuildRoleAllowedSuccess"), role)); + res.send(String.format(LocStrings.stub("GuildRoleAllowedSuccess"), role)); } } } diff --git a/src/commands/CommandGuildRoleList.java b/src/commands/CommandGuildRoleList.java index 7ac0c47..f23a30e 100644 --- a/src/commands/CommandGuildRoleList.java +++ b/src/commands/CommandGuildRoleList.java @@ -17,7 +17,7 @@ public class CommandGuildRoleList extends Command String roles = ""; if(guild.roleList.isEmpty()) { - res.call(String.format(LocStrings.stub("GuildRoleListEmpty"))); + res.send(String.format(LocStrings.stub("GuildRoleListEmpty"))); return; } for(int i = 0; i < guild.roleList.size(); i++) @@ -26,6 +26,6 @@ public class CommandGuildRoleList extends Command roles += " and "; roles += guild.roleList.get(i); } - res.call(String.format(LocStrings.stub("GuildRoleListOutput"), roles)); + res.send(String.format(LocStrings.stub("GuildRoleListOutput"), roles)); } } \ No newline at end of file diff --git a/src/commands/CommandGuildRoleNotAllowed.java b/src/commands/CommandGuildRoleNotAllowed.java index 6e4c844..d95c440 100644 --- a/src/commands/CommandGuildRoleNotAllowed.java +++ b/src/commands/CommandGuildRoleNotAllowed.java @@ -28,11 +28,11 @@ public class CommandGuildRoleNotAllowed extends Command if(guild.roleList.contains(role)) { guild.roleList.remove(role); - res.call(LocStrings.stub("GuildRoleNotAllowedSuccess")); + res.send(LocStrings.stub("GuildRoleNotAllowedSuccess")); } else { - res.call(String.format(LocStrings.stub("GuildRoleNotAllowedFailure"), role)); + res.send(String.format(LocStrings.stub("GuildRoleNotAllowedFailure"), role)); } } } diff --git a/src/commands/CommandGuildRoleRemove.java b/src/commands/CommandGuildRoleRemove.java index 275af3a..32ab8e6 100644 --- a/src/commands/CommandGuildRoleRemove.java +++ b/src/commands/CommandGuildRoleRemove.java @@ -25,16 +25,16 @@ public class CommandGuildRoleRemove extends Command { 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 { - res.call(String.format(LocStrings.stub("GuildRoleRemoveFailure"), role, user.name)); + res.send(String.format(LocStrings.stub("GuildRoleRemoveFailure"), role, user.name)); } } else { - res.call(String.format(LocStrings.stub("GuildRoleRemoveNotAllowed"), role)); + res.send(String.format(LocStrings.stub("GuildRoleRemoveNotAllowed"), role)); } } } \ No newline at end of file diff --git a/src/commands/CommandHelp.java b/src/commands/CommandHelp.java index 8c0a5e9..0340e2e 100644 --- a/src/commands/CommandHelp.java +++ b/src/commands/CommandHelp.java @@ -27,7 +27,7 @@ public class CommandHelp extends Command help = LocStrings.stub("HelpDisplay"); } - res.call(help); + res.send(help); } } \ No newline at end of file diff --git a/src/commands/CommandHelpBuilder.java b/src/commands/CommandHelpBuilder.java index d2f6242..3898c12 100644 --- a/src/commands/CommandHelpBuilder.java +++ b/src/commands/CommandHelpBuilder.java @@ -68,7 +68,7 @@ public class CommandHelpBuilder extends Command { } File file = new File(filename); - res.CallFile(file, "txt"); + res.sendFile(file, "txt"); ImageUtils.BlockingFileDelete(file); } diff --git a/src/commands/CommandInfo.java b/src/commands/CommandInfo.java index 80bafcf..8869203 100644 --- a/src/commands/CommandInfo.java +++ b/src/commands/CommandInfo.java @@ -20,6 +20,6 @@ public class CommandInfo extends Command @Override public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res) { - res.call(LocStrings.stub("InfoResponse")); + res.send(LocStrings.stub("InfoResponse")); } } \ No newline at end of file diff --git a/src/commands/CommandInvite.java b/src/commands/CommandInvite.java index b6b576d..efb2f71 100644 --- a/src/commands/CommandInvite.java +++ b/src/commands/CommandInvite.java @@ -15,7 +15,7 @@ public class CommandInvite extends Command @Override 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"); } } \ No newline at end of file diff --git a/src/commands/CommandJDoodle.java b/src/commands/CommandJDoodle.java index 6ba5149..67165f0 100644 --- a/src/commands/CommandJDoodle.java +++ b/src/commands/CommandJDoodle.java @@ -19,10 +19,10 @@ public class CommandJDoodle extends Command { if(input.args.trim().length() < 1) { - res.call(LocStrings.stub("JDoodleError")); + res.send(LocStrings.stub("JDoodleError")); return; } - res.call(compiler.compileJava(input.args)); + res.send(compiler.compileJava(input.args)); } } diff --git a/src/commands/CommandLeaderboard.java b/src/commands/CommandLeaderboard.java index 2ed622e..29914c5 100644 --- a/src/commands/CommandLeaderboard.java +++ b/src/commands/CommandLeaderboard.java @@ -94,6 +94,6 @@ public class CommandLeaderboard extends Command } // Write out embed result - res.callEmbed(embed); + res.send(embed); } } diff --git a/src/commands/CommandMap.java b/src/commands/CommandMap.java index 575f7e9..e337f3f 100644 --- a/src/commands/CommandMap.java +++ b/src/commands/CommandMap.java @@ -60,7 +60,7 @@ public class CommandMap extends Command } catch(NumberFormatException e) { - res.call(LocStrings.stub("MapInvalid")); + res.send(LocStrings.stub("MapInvalid")); return; } @@ -87,7 +87,7 @@ public class CommandMap extends Command body += "\n```"; // Send back the map - res.call(header + body); + res.send(header + body); } // Verifies and appropriately caps input as necessary diff --git a/src/commands/CommandPerish.java b/src/commands/CommandPerish.java index b743cdf..9089a72 100644 --- a/src/commands/CommandPerish.java +++ b/src/commands/CommandPerish.java @@ -67,7 +67,7 @@ public class CommandPerish extends Command } postProcessed = new File(name); - res.CallFile(postProcessed, "png"); + res.sendFile(postProcessed, "png"); ImageUtils.BlockingFileDelete(preProcessed); ImageUtils.BlockingFileDelete(postProcessed); diff --git a/src/commands/CommandPing.java b/src/commands/CommandPing.java index a75e3e8..e5f8d62 100644 --- a/src/commands/CommandPing.java +++ b/src/commands/CommandPing.java @@ -21,6 +21,6 @@ public class CommandPing extends Command @Override public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res) { - res.call(LocStrings.stub("PingResponse")); + res.send(LocStrings.stub("PingResponse")); } } diff --git a/src/commands/CommandPollManage.java b/src/commands/CommandPollManage.java index 5d1d738..5457a1b 100644 --- a/src/commands/CommandPollManage.java +++ b/src/commands/CommandPollManage.java @@ -22,15 +22,15 @@ public class CommandPollManage extends Command switch(input.args.split(" ")[0].toLowerCase()) { 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; 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; case "stop": - res.call(guild.endPoll()); + res.send(guild.endPoll()); break; default: diff --git a/src/commands/CommandPollResults.java b/src/commands/CommandPollResults.java index b066d0d..638bb81 100644 --- a/src/commands/CommandPollResults.java +++ b/src/commands/CommandPollResults.java @@ -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)); } - res.call(results); + res.send(results); } } diff --git a/src/commands/CommandPollShow.java b/src/commands/CommandPollShow.java index 6006dc1..c92ab2d 100644 --- a/src/commands/CommandPollShow.java +++ b/src/commands/CommandPollShow.java @@ -15,7 +15,7 @@ public class CommandPollShow extends Command { if(!guild.polling) { - res.call(LocStrings.stub("PollShowNoPoll")); + res.send(LocStrings.stub("PollShowNoPoll")); return; } 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"; } - res.call(poll); + res.send(poll); } } diff --git a/src/commands/CommandPollVote.java b/src/commands/CommandPollVote.java index 17cfbde..b3012f1 100644 --- a/src/commands/CommandPollVote.java +++ b/src/commands/CommandPollVote.java @@ -17,7 +17,7 @@ public class CommandPollVote extends Command { if(guild.hasVoted.contains(user.uniqueID)) { - res.call(LocStrings.stub("PollVoteAlreadyVoted")); + res.send(LocStrings.stub("PollVoteAlreadyVoted")); return; } try @@ -25,23 +25,23 @@ public class CommandPollVote extends Command int voteNum = Integer.parseInt(input.args)-1; if(voteNum >= guild.choices.size() || voteNum < 0) { - res.call(String.format(LocStrings.stub("PollVoteNotValidVote"), voteNum)); + res.send(String.format(LocStrings.stub("PollVoteNotValidVote"), voteNum)); return; } KittyPoll polled = guild.choices.get(voteNum); polled.votes++; guild.hasVoted.add(user.uniqueID); - res.call(LocStrings.stub("PollVoteSuccess") + " `" + polled.choice + "`!"); + res.send(LocStrings.stub("PollVoteSuccess") + " `" + polled.choice + "`!"); return; } catch (NumberFormatException e) { - res.call(LocStrings.stub("PollVoteNotValidNumber")); + res.send(LocStrings.stub("PollVoteNotValidNumber")); return; } } - res.call(LocStrings.stub("PollVoteNoPoll")); + res.send(LocStrings.stub("PollVoteNoPoll")); } } diff --git a/src/commands/CommandRPEnd.java b/src/commands/CommandRPEnd.java index b4500f9..355b691 100644 --- a/src/commands/CommandRPEnd.java +++ b/src/commands/CommandRPEnd.java @@ -32,12 +32,12 @@ public class CommandRPEnd extends Command if(sending != null) { - res.CallFile(sending, "txt"); - res.call(LocStrings.stub("RPEndFileOut")); + res.sendFile(sending, "txt"); + res.send(LocStrings.stub("RPEndFileOut")); } else { - res.call(LocStrings.stub("RPEndError")); + res.send(LocStrings.stub("RPEndError")); } } } diff --git a/src/commands/CommandRPG.java b/src/commands/CommandRPG.java index 2f46a65..bb7ca35 100644 --- a/src/commands/CommandRPG.java +++ b/src/commands/CommandRPG.java @@ -32,7 +32,7 @@ public class CommandRPG extends Command if(input.args == null || input.args.length() == 0) { String output = getHelpText(); - res.call(output); + res.send(output); return; } @@ -44,10 +44,10 @@ public class CommandRPG extends Command if(result == null) { - res.call(LocStrings.stub("RPGInvalid")); + res.send(LocStrings.stub("RPGInvalid")); return; } - res.call(result); + res.send(result); } } diff --git a/src/commands/CommandRPStart.java b/src/commands/CommandRPStart.java index 8ce235c..866b6f8 100644 --- a/src/commands/CommandRPStart.java +++ b/src/commands/CommandRPStart.java @@ -27,6 +27,6 @@ public class CommandRPStart extends Command } } - res.call(RPManager.instance.newRP(channel, users)); + res.send(RPManager.instance.newRP(channel, users)); } } diff --git a/src/commands/CommandRaffleEnd.java b/src/commands/CommandRaffleEnd.java index 804e3cf..735c604 100644 --- a/src/commands/CommandRaffleEnd.java +++ b/src/commands/CommandRaffleEnd.java @@ -22,11 +22,11 @@ public class CommandRaffleEnd extends Command { if(guild.endRaffle()) { - res.call(LocStrings.stub("RaffleEndSuccess")); + res.send(LocStrings.stub("RaffleEndSuccess")); } else { - res.call(LocStrings.stub("RaffleEndFailure")); + res.send(LocStrings.stub("RaffleEndFailure")); } } } \ No newline at end of file diff --git a/src/commands/CommandRaffleJoin.java b/src/commands/CommandRaffleJoin.java index c216650..0b6a78f 100644 --- a/src/commands/CommandRaffleJoin.java +++ b/src/commands/CommandRaffleJoin.java @@ -22,11 +22,11 @@ public class CommandRaffleJoin extends Command { if(guild.joinRaffle(user)) { - res.call(LocStrings.stub("RaffleJoinSuccess")); + res.send(LocStrings.stub("RaffleJoinSuccess")); } else { - res.call(LocStrings.stub("RaffleJoinFailure")); + res.send(LocStrings.stub("RaffleJoinFailure")); } } } diff --git a/src/commands/CommandRaffleSpin.java b/src/commands/CommandRaffleSpin.java index 3eefeb7..3889252 100644 --- a/src/commands/CommandRaffleSpin.java +++ b/src/commands/CommandRaffleSpin.java @@ -22,11 +22,11 @@ public class CommandRaffleSpin extends Command { try { - res.call(String.format(LocStrings.stub("RaffleSpinSuccess"), guild.chooseRaffleWinner().name)); + res.send(String.format(LocStrings.stub("RaffleSpinSuccess"), guild.chooseRaffleWinner().name)); } catch(Exception e) { - res.call(LocStrings.stub("RaffleSpinFailure")); + res.send(LocStrings.stub("RaffleSpinFailure")); } } } \ No newline at end of file diff --git a/src/commands/CommandRaffleStart.java b/src/commands/CommandRaffleStart.java index 429c0d4..57468a3 100644 --- a/src/commands/CommandRaffleStart.java +++ b/src/commands/CommandRaffleStart.java @@ -33,11 +33,11 @@ public class CommandRaffleStart extends Command if(guild.startRaffle(beanCost)) { - res.call(String.format(LocStrings.stub("RaffleStartSuccess"), beanCost)); + res.send(String.format(LocStrings.stub("RaffleStartSuccess"), beanCost)); } else { - res.call(LocStrings.stub("RaffleStartFailure")); + res.send(LocStrings.stub("RaffleStartFailure")); } } } diff --git a/src/commands/CommandRating.java b/src/commands/CommandRating.java index 1ae6171..6947e77 100644 --- a/src/commands/CommandRating.java +++ b/src/commands/CommandRating.java @@ -55,11 +55,11 @@ public class CommandRating extends Command } if(newRating != null) - res.call(LocStrings.stub("RatingChanged") + " " + newRating); + res.send(LocStrings.stub("RatingChanged") + " " + newRating); else - res.call(LocStrings.stub("RatingInvalid") + " `" + input.args + "`"); + res.send(LocStrings.stub("RatingInvalid") + " `" + input.args + "`"); if(newRating.equals("Filtered")) - res.call(LocStrings.stub("RatingWarning")); + res.send(LocStrings.stub("RatingWarning")); } } \ No newline at end of file diff --git a/src/commands/CommandRole.java b/src/commands/CommandRole.java index c7c83d1..2261620 100644 --- a/src/commands/CommandRole.java +++ b/src/commands/CommandRole.java @@ -16,13 +16,13 @@ public class CommandRole extends Command { if(input.args.isEmpty()) { - res.call(LocStrings.stub("RoleStandardResponse") + " " + user.GetRole().name() + "!"); + res.send(LocStrings.stub("RoleStandardResponse") + " " + user.GetRole().name() + "!"); return; } 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; } @@ -46,7 +46,7 @@ public class CommandRole extends Command break; default: - res.call(LocStrings.stub("RoleNeededRole")); + res.send(LocStrings.stub("RoleNeededRole")); return; } String users = ""; @@ -56,6 +56,6 @@ public class CommandRole extends Command 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())); } } diff --git a/src/commands/CommandRoll.java b/src/commands/CommandRoll.java index c76c850..046c2c0 100644 --- a/src/commands/CommandRoll.java +++ b/src/commands/CommandRoll.java @@ -23,11 +23,11 @@ public class CommandRoll extends Command { try { - res.call(rollDice(input.args)); + res.send(rollDice(input.args)); } catch(Exception e) { - res.call(LocStrings.stub("RollError")); + res.send(LocStrings.stub("RollError")); } } diff --git a/src/commands/CommandShutdown.java b/src/commands/CommandShutdown.java index 45fe80e..ddb8e41 100644 --- a/src/commands/CommandShutdown.java +++ b/src/commands/CommandShutdown.java @@ -46,7 +46,7 @@ public class CommandShutdown extends Command if(isSafe) { // 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(); GlobalLog.Warn(LogFilter.Command, LocStrings.Lookup("ShutdownSafe")); @@ -54,7 +54,7 @@ public class CommandShutdown extends Command } else { - res.CallImmediate(LocStrings.stub("ShutdownUnsafe"));// "``"); + res.sendImmediate(LocStrings.stub("ShutdownUnsafe"));// "``"); GlobalLog.Warn(LogFilter.Command, LocStrings.Lookup("ShutdownSafe")); System.exit(0); } diff --git a/src/commands/CommandStark.java b/src/commands/CommandStark.java index e1e4d18..24865e0 100644 --- a/src/commands/CommandStark.java +++ b/src/commands/CommandStark.java @@ -61,7 +61,7 @@ public class CommandStark extends Command } postProcessed = new File(name); - res.CallFile(postProcessed, "png"); + res.sendFile(postProcessed, "png"); ImageUtils.BlockingFileDelete(preProcessed); ImageUtils.BlockingFileDelete(postProcessed); diff --git a/src/commands/CommandStats.java b/src/commands/CommandStats.java index dc4ff72..b7211be 100644 --- a/src/commands/CommandStats.java +++ b/src/commands/CommandStats.java @@ -66,6 +66,11 @@ public class CommandStats extends Command + " Cached Users: " + userCount; out += "\n```"; - res.call(out); + KittyEmbed embed = new KittyEmbed(); + embed.title = "Bot Stats"; + embed.descriptionText = out; + embed.color = Config.ColorDefault; + + res.send(embed); } } diff --git a/src/commands/CommandTeey.java b/src/commands/CommandTeey.java index 5ece546..8ba9f4d 100644 --- a/src/commands/CommandTeey.java +++ b/src/commands/CommandTeey.java @@ -62,7 +62,7 @@ public class CommandTeey extends Command } teeyFile = new File (name); - res.CallFile(teeyFile, "gif"); + res.sendFile(teeyFile, "gif"); // Thread cleanup... ImageUtils.BlockingFileDelete(teeyFile); diff --git a/src/commands/CommandTradeBeans.java b/src/commands/CommandTradeBeans.java index a26fb7a..b166787 100644 --- a/src/commands/CommandTradeBeans.java +++ b/src/commands/CommandTradeBeans.java @@ -22,7 +22,7 @@ public class CommandTradeBeans extends Command { if(input.mentions == null) { - res.call(LocStrings.stub("TradeBeansNoTargetError")); + res.send(LocStrings.stub("TradeBeansNoTargetError")); return; } @@ -32,25 +32,25 @@ public class CommandTradeBeans extends Command } catch (NumberFormatException e) { - res.call(LocStrings.stub("TradeBeansIntParseError")); + res.send(LocStrings.stub("TradeBeansIntParseError")); return; } if(user.GetBeans() < beans) { - res.call(LocStrings.stub("TradeBeansNotEnoughError")); + res.send(LocStrings.stub("TradeBeansNotEnoughError")); return; } if(beans < 0) { - res.call(String.format(LocStrings.stub("TradeBeansStealingBeans"), user.name)); + res.send(String.format(LocStrings.stub("TradeBeansStealingBeans"), user.name)); user.ChangeBeans(-10); return; } input.mentions[0].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)); } } diff --git a/src/commands/CommandTweet.java b/src/commands/CommandTweet.java index 403eb0e..5334900 100644 --- a/src/commands/CommandTweet.java +++ b/src/commands/CommandTweet.java @@ -18,9 +18,9 @@ public class CommandTweet extends Command { //TODO: Figure out how to pass pictures correctly try { - res.call(tweet.tweet(input.args)); + res.send(tweet.tweet(input.args)); } catch (Exception e) { - res.call(LocStrings.stub("TweetError")); + res.send(LocStrings.stub("TweetError")); } } } diff --git a/src/commands/CommandWolfram.java b/src/commands/CommandWolfram.java index 15f706c..54b26b4 100644 --- a/src/commands/CommandWolfram.java +++ b/src/commands/CommandWolfram.java @@ -21,17 +21,17 @@ public class CommandWolfram extends Command public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res) { if(input.args == null || input.args.trim().length() == 0) - res.call(LocStrings.stub("WolframNoArgs")); + res.send(LocStrings.stub("WolframNoArgs")); try { File pic = new File(searcher.getWolfram(input.args)); - res.CallFile(pic, "png"); + res.sendFile(pic, "png"); ImageUtils.BlockingFileDelete(pic); } catch (IOException e) { - res.call(LocStrings.stub("WolframError")); + res.send(LocStrings.stub("WolframError")); } } } \ No newline at end of file diff --git a/src/commands/CommandYeet.java b/src/commands/CommandYeet.java index 3e71bde..6fd467b 100644 --- a/src/commands/CommandYeet.java +++ b/src/commands/CommandYeet.java @@ -62,7 +62,7 @@ public class CommandYeet extends Command } yeetFile = new File (name); - res.CallFile(yeetFile, "gif"); + res.sendFile(yeetFile, "gif"); // Thread cleanup... ImageUtils.BlockingFileDelete(yeetFile); diff --git a/src/core/RPManager.java b/src/core/RPManager.java index f56be78..126d90e 100644 --- a/src/core/RPManager.java +++ b/src/core/RPManager.java @@ -71,7 +71,7 @@ public class RPManager { reminder += " <@" + users.get(i) + ">"; } - res.CallToChannel(reminder, entry.getValue().getChannel().uniqueID); + res.sendToChannel(reminder, entry.getValue().getChannel().uniqueID); reminder = ""; entry.getValue().resetTimer(); diff --git a/src/core/benchmark/BenchmarkFormattable.java b/src/core/benchmark/BenchmarkFormattable.java index f2462b8..7261ea6 100644 --- a/src/core/benchmark/BenchmarkFormattable.java +++ b/src/core/benchmark/BenchmarkFormattable.java @@ -33,8 +33,8 @@ public class BenchmarkFormattable public void call(Response res) { if(resEmbed == null) - res.call(resString); + res.send(resString); else - res.callEmbed(resEmbed); + res.send(resEmbed); } } diff --git a/src/dataStructures/Response.java b/src/dataStructures/Response.java index c46a6db..18549e0 100644 --- a/src/dataStructures/Response.java +++ b/src/dataStructures/Response.java @@ -30,7 +30,7 @@ public class Response } // Builds a nicely formatted embedded message based on information provided - public void callEmbed(KittyEmbed embedInfo) + public void send(KittyEmbed embedInfo) { EmbedBuilder embed = new EmbedBuilder(); @@ -83,13 +83,12 @@ public class Response if(embedInfo.thumbnailURL != null) 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. - public void call(String toRespondWith) + public void send(String toRespondWith) { GlobalLog.Log(LogFilter.Response, "Sending response: " + toRespondWith); if(toRespondWith.length() > discordMessageMax) @@ -103,7 +102,7 @@ public class Response } // 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; channel = kitty.getTextChannelById(Long.parseLong(channelID)); @@ -118,7 +117,7 @@ public class Response } // 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); if(toRespondWith.length() > discordMessageMax) @@ -132,14 +131,14 @@ public class Response } // 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"); event.getChannel().sendFile(toRespondWith, "return." + extension).queue(); } // 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"); event.getChannel().sendFile(in, "return." + extension).queue(); diff --git a/src/main/Main.java b/src/main/Main.java index 3701297..fb78efd 100644 --- a/src/main/Main.java +++ b/src/main/Main.java @@ -106,7 +106,7 @@ public class Main extends ListenerAdapter } else { - response.call(pluginOutput.get(i)); + response.send(pluginOutput.get(i)); } } }