= Selectively adjusted casing on localization stubs.

This commit is contained in:
Matthew Cech
2019-06-02 17:49:23 -07:00
parent 1bbce7eb58
commit 5212ef64bf
55 changed files with 214 additions and 214 deletions
+3 -3
View File
@@ -9,13 +9,13 @@ public class CommandBeansShow extends Command
public CommandBeansShow(KittyRole level, KittyRating rating) { super(level, rating); } public CommandBeansShow(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("BeansShowInfo"); }; public String getHelpText() { return LocStrings.stub("BeansShowInfo"); };
@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)
{ {
if(input.mentions == null) if(input.mentions == null)
res.Call(String.format(LocStrings.Stub("BeansShowDisplay"), user.GetBeans())); res.Call(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.Call(String.format(LocStrings.stub("BeansShowMentioned"), mentionedBeans));
} }
} }
} }
+2 -2
View File
@@ -25,7 +25,7 @@ public class CommandBenchmark extends Command
} }
@Override @Override
public String getHelpText() { return LocStrings.Stub("BenchmarkInfo"); } public String getHelpText() { return LocStrings.stub("BenchmarkInfo"); }
@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)
@@ -47,7 +47,7 @@ public class CommandBenchmark extends Command
if(commandOutput == null) if(commandOutput == null)
{ {
res.Call(LocStrings.Stub("BenchmarkInvalid")); res.Call(LocStrings.stub("BenchmarkInvalid"));
return; return;
} }
+6 -6
View File
@@ -11,7 +11,7 @@ public class CommandBetBeans extends Command
public CommandBetBeans(KittyRole level, KittyRating rating) { super(level, rating); } public CommandBetBeans(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("BetBeansInfo"); } public String getHelpText() { return LocStrings.stub("BetBeansInfo"); }
@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)
@@ -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.Call(LocStrings.stub("BetBeansLowBet"));
return; return;
} }
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
res.Call(LocStrings.Stub("BetBeansNotValid")); res.Call(LocStrings.stub("BetBeansNotValid"));
return; return;
} }
if(user.GetBeans() < bet) if(user.GetBeans() < bet)
{ {
res.Call(LocStrings.Stub("BetBeansNotEnough")); res.Call(LocStrings.stub("BetBeansNotEnough"));
return; return;
} }
@@ -51,14 +51,14 @@ public class CommandBetBeans extends Command
if(win == 0) if(win == 0)
{ {
res.Call(LocStrings.Stub("BetBeansLose")); res.Call(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.Call(String.format(LocStrings.stub("BetBeansWin"), "" + (bet*win)));
} }
private int getWinning(int [] slots) private int getWinning(int [] slots)
+2 -2
View File
@@ -15,11 +15,11 @@ public class CommandBetHistory extends Command
public CommandBetHistory(KittyRole level, KittyRating rating) { super(level, rating); } public CommandBetHistory(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("BetHistoryInfo"); } public String getHelpText() { return LocStrings.stub("BetHistoryInfo"); }
@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.Call(String.format(LocStrings.stub("BetHistoryOutput"), guild.beans.Get()));
} }
} }
+1 -1
View File
@@ -17,7 +17,7 @@ public class CommandBlurry extends Command
public CommandBlurry(KittyRole level, KittyRating rating) { super(level, rating); } public CommandBlurry(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("BlurryInfo"); }; public String getHelpText() { return LocStrings.stub("BlurryInfo"); };
private static Long num = 0l; private static Long num = 0l;
+4 -4
View File
@@ -60,7 +60,7 @@ public class CommandBoop extends Command
} }
@Override @Override
public String getHelpText() { return LocStrings.Stub("BoopInfo"); } public String getHelpText() { return LocStrings.stub("BoopInfo"); }
// Called when the command is run! // Called when the command is run!
@Override @Override
@@ -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.Call(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.Call(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.Call(String.format(LocStrings.stub("BoopMultiple"), user.name, booped));
} }
} }
} }
+1 -1
View File
@@ -23,7 +23,7 @@ public class CommandCatch extends Command
private static Long num = 0l; private static Long num = 0l;
@Override @Override
public String getHelpText() { return LocStrings.Stub("CatchInfo"); } public String getHelpText() { return LocStrings.stub("CatchInfo"); }
// Called when the command is run! // Called when the command is run!
@Override @Override
+3 -3
View File
@@ -9,7 +9,7 @@ public class CommandChangeIndicator extends Command
public CommandChangeIndicator(KittyRole level, KittyRating rating) { super(level, rating); } public CommandChangeIndicator(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("ChangeIndicatorInfo"); } public String getHelpText() { return LocStrings.stub("ChangeIndicatorInfo"); }
@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)
@@ -17,7 +17,7 @@ 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.Call(LocStrings.stub("ChangeIndicatorError"));
return; return;
} }
@@ -29,6 +29,6 @@ public class CommandChangeIndicator extends Command
} }
guild.SetCommandIndicator(indicator); guild.SetCommandIndicator(indicator);
res.Call(String.format(LocStrings.Stub("ChangeIndicatorChanged"), guild.GetCommandIndicator())); res.Call(String.format(LocStrings.stub("ChangeIndicatorChanged"), guild.GetCommandIndicator()));
} }
} }
+3 -3
View File
@@ -14,7 +14,7 @@ public class CommandChoose extends Command
public CommandChoose(KittyRole level, KittyRating rating) { super(level, rating); } public CommandChoose(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("ChooseInfo"); } public String getHelpText() { return LocStrings.stub("ChooseInfo"); }
@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)
@@ -22,10 +22,10 @@ public class CommandChoose extends Command
String [] choices = input.args.split(","); String [] choices = input.args.split(",");
if(choices.length == 1) if(choices.length == 1)
{ {
res.Call(LocStrings.Stub("ChooseOne")); res.Call(LocStrings.stub("ChooseOne"));
return; return;
} }
res.Call(String.format(LocStrings.Stub("ChooseChoice"), (choices[(int) (Math.random()*choices.length)]).toString())); res.Call(String.format(LocStrings.stub("ChooseChoice"), (choices[(int) (Math.random()*choices.length)]).toString()));
} }
} }
+2 -2
View File
@@ -12,14 +12,14 @@ public class CommandColiru extends Command
public CommandColiru(KittyRole level, KittyRating rating) { super(level, rating);} public CommandColiru(KittyRole level, KittyRating rating) { super(level, rating);}
@Override @Override
public String getHelpText() { return LocStrings.Stub("ColiruInfo"); } public String getHelpText() { return LocStrings.stub("ColiruInfo"); }
@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)
{ {
if(input.args.trim().length() < 1) if(input.args.trim().length() < 1)
{ {
res.Call(LocStrings.Stub("ColiruError")); res.Call(LocStrings.stub("ColiruError"));
return; return;
} }
+1 -1
View File
@@ -18,7 +18,7 @@ public class CommandCrouton extends Command
public CommandCrouton(KittyRole level, KittyRating rating) { super(level, rating); } public CommandCrouton(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("CroutonInfo"); }; public String getHelpText() { return LocStrings.stub("CroutonInfo"); };
@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)
+1 -1
View File
@@ -19,7 +19,7 @@ public class CommandDBFlush extends Command
public CommandDBFlush(KittyRole level, KittyRating rating) { super(level, rating); } public CommandDBFlush(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("DBFlushInfo"); } public String getHelpText() { return LocStrings.stub("DBFlushInfo"); }
@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)
+1 -1
View File
@@ -26,7 +26,7 @@ public class CommandDBStats extends Command
} }
@Override @Override
public String getHelpText() { return LocStrings.Stub("DBStatsInfo"); } public String getHelpText() { return LocStrings.stub("DBStatsInfo"); }
@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)
+2 -2
View File
@@ -15,7 +15,7 @@ public class CommandDoWork extends Command
public CommandDoWork(KittyRole level, KittyRating rating) { super(level, rating); } public CommandDoWork(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("DoWorkInfo"); } public String getHelpText() { return LocStrings.stub("DoWorkInfo"); }
// Called when the command is run! // Called when the command is run!
@Override @Override
@@ -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.Call(LocStrings.stub("DoWorkFinished"));
} }
} }
+22 -22
View File
@@ -8,40 +8,40 @@ public class CommandEightBall extends Command
{ {
String [] answers = String [] answers =
{ {
LocStrings.Stub("EightBallYes1") LocStrings.stub("EightBallYes1")
, LocStrings.Stub("EightBallYes2") , LocStrings.stub("EightBallYes2")
, LocStrings.Stub("EightBallYes3") , LocStrings.stub("EightBallYes3")
, LocStrings.Stub("EightBallYes4") , LocStrings.stub("EightBallYes4")
, LocStrings.Stub("EightBallYes5") , LocStrings.stub("EightBallYes5")
, LocStrings.Stub("EightBallYes6") , LocStrings.stub("EightBallYes6")
, LocStrings.Stub("EightBallYes7") , LocStrings.stub("EightBallYes7")
, LocStrings.Stub("EightBallYes8") , LocStrings.stub("EightBallYes8")
, LocStrings.Stub("EightBallYes9") , LocStrings.stub("EightBallYes9")
, LocStrings.Stub("EightBallYes10") , LocStrings.stub("EightBallYes10")
, LocStrings.Stub("EightBallMaybe1") , LocStrings.stub("EightBallMaybe1")
, LocStrings.Stub("EightBallMaybe2") , LocStrings.stub("EightBallMaybe2")
, LocStrings.Stub("EightBallMaybe3") , LocStrings.stub("EightBallMaybe3")
, LocStrings.Stub("EightBallMaybe4") , LocStrings.stub("EightBallMaybe4")
, LocStrings.Stub("EightBallMaybe5") , LocStrings.stub("EightBallMaybe5")
, LocStrings.Stub("EightBallNo1") , LocStrings.stub("EightBallNo1")
, LocStrings.Stub("EightBallNo2") , LocStrings.stub("EightBallNo2")
, LocStrings.Stub("EightBallNo3") , LocStrings.stub("EightBallNo3")
, LocStrings.Stub("EightBallNo4") , LocStrings.stub("EightBallNo4")
, LocStrings.Stub("EightBallNo5") , LocStrings.stub("EightBallNo5")
}; };
public CommandEightBall(KittyRole level, KittyRating rating) { super(level, rating); } public CommandEightBall(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("EightBallInfo"); } public String getHelpText() { return LocStrings.stub("EightBallInfo"); }
@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)
{ {
if(input.args.trim().length() < 1) if(input.args.trim().length() < 1)
res.Call(LocStrings.Stub("EightBallError")); res.Call(LocStrings.stub("EightBallError"));
res.Call(answers[(int) (Math.random()*answers.length)]); res.Call(answers[(int) (Math.random()*answers.length)]);
} }
+8 -8
View File
@@ -15,7 +15,7 @@ public class CommandFetch extends Command
public CommandFetch(KittyRole level, KittyRating rating) { super(level, rating); } public CommandFetch(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("FetchInfo"); } public String getHelpText() { return LocStrings.stub("FetchInfo"); }
@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)
@@ -27,22 +27,22 @@ public class CommandFetch extends Command
switch(num) switch(num)
{ {
case 1: case 1:
res.Call(String.format(LocStrings.Stub("FetchBringBack"), emote)); res.Call(String.format(LocStrings.stub("FetchBringBack"), emote));
break; break;
case 2: case 2:
res.Call(String.format(LocStrings.Stub("FetchRunAway"))); res.Call(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.Call(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.Call(String.format(LocStrings.stub("FetchEat"), emote));
break; break;
case 5: case 5:
res.Call(String.format(LocStrings.Stub("FetchCatchRun"), emote)); res.Call(String.format(LocStrings.stub("FetchCatchRun"), emote));
break; break;
case 6: case 6:
res.Call(String.format(LocStrings.Stub("FetchStare"), user.name)); res.Call(String.format(LocStrings.stub("FetchStare"), user.name));
break; break;
default: default:
res.Call("" + num); res.Call("" + num);
@@ -50,7 +50,7 @@ public class CommandFetch extends Command
} }
else else
{ {
res.Call(String.format(LocStrings.Stub("FetchError"))); res.Call(String.format(LocStrings.stub("FetchError")));
System.out.println(emote); System.out.println(emote);
} }
} }
+4 -4
View File
@@ -9,7 +9,7 @@ public class CommandGiveBeans extends Command
public CommandGiveBeans (KittyRole level, KittyRating rating) { super(level, rating); } public CommandGiveBeans (KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("GiveBeansInfo"); } public String getHelpText() { return LocStrings.stub("GiveBeansInfo"); }
@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)
@@ -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.Call(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.Call(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.Call(String.format(LocStrings.stub("GiveBeansSuccess"), input.mentions[i].name, "" + beans));
} }
} }
} }
+4 -4
View File
@@ -15,7 +15,7 @@ public class CommandGuildRoleAdd extends Command
public CommandGuildRoleAdd(KittyRole level, KittyRating rating) { super(level, rating); } public CommandGuildRoleAdd(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("GuildRoleAddInfo"); }; public String getHelpText() { return LocStrings.stub("GuildRoleAddInfo"); };
@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)
@@ -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.Call(String.format(LocStrings.stub("GuildRoleAddSuccess"), role, user.name));
} }
else else
{ {
res.Call(String.format(LocStrings.Stub("GuildRoleAddFailure"), role, user.name)); res.Call(String.format(LocStrings.stub("GuildRoleAddFailure"), role, user.name));
} }
} }
else else
{ {
res.Call(String.format(LocStrings.Stub("GuildRoleAddNotAllowed"), role)); res.Call(String.format(LocStrings.stub("GuildRoleAddNotAllowed"), role));
} }
} }
} }
+3 -3
View File
@@ -15,7 +15,7 @@ public class CommandGuildRoleAllowed extends Command
public CommandGuildRoleAllowed(KittyRole level, KittyRating rating) { super(level, rating); } public CommandGuildRoleAllowed(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("GuildRoleAllowedInfo"); } public String getHelpText() { return LocStrings.stub("GuildRoleAllowedInfo"); }
@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)
@@ -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.Call(LocStrings.stub("GuildRoleAllowedDuplicate"));
} }
else else
{ {
guild.roleList.add(role); guild.roleList.add(role);
res.Call(String.format(LocStrings.Stub("GuildRoleAllowedSuccess"), role)); res.Call(String.format(LocStrings.stub("GuildRoleAllowedSuccess"), role));
} }
} }
} }
+2 -2
View File
@@ -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.Call(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.Call(String.format(LocStrings.stub("GuildRoleListOutput"), roles));
} }
} }
+3 -3
View File
@@ -15,7 +15,7 @@ public class CommandGuildRoleNotAllowed extends Command
public CommandGuildRoleNotAllowed(KittyRole level, KittyRating rating) { super(level, rating); } public CommandGuildRoleNotAllowed(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("GuildRoleNotAllowedInfo"); } public String getHelpText() { return LocStrings.stub("GuildRoleNotAllowedInfo"); }
@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)
@@ -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.Call(LocStrings.stub("GuildRoleNotAllowedSuccess"));
} }
else else
{ {
res.Call(String.format(LocStrings.Stub("GuildRoleNotAllowedFailure"), role)); res.Call(String.format(LocStrings.stub("GuildRoleNotAllowedFailure"), role));
} }
} }
} }
+4 -4
View File
@@ -15,7 +15,7 @@ public class CommandGuildRoleRemove extends Command
public CommandGuildRoleRemove(KittyRole level, KittyRating rating) { super(level, rating); } public CommandGuildRoleRemove(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("GuildRoleRemoveInfo"); }; public String getHelpText() { return LocStrings.stub("GuildRoleRemoveInfo"); };
@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)
@@ -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.Call(String.format(LocStrings.stub("GuildRoleRemoveSuccess"), role, user.name));
} }
else else
{ {
res.Call(String.format(LocStrings.Stub("GuildRoleRemoveFailure"), role, user.name)); res.Call(String.format(LocStrings.stub("GuildRoleRemoveFailure"), role, user.name));
} }
} }
else else
{ {
res.Call(String.format(LocStrings.Stub("GuildRoleRemoveNotAllowed"), role)); res.Call(String.format(LocStrings.stub("GuildRoleRemoveNotAllowed"), role));
} }
} }
} }
+2 -2
View File
@@ -15,7 +15,7 @@ public class CommandHelp extends Command
public CommandHelp(KittyRole level, KittyRating rating) { super(level, rating); } public CommandHelp(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("HelpInfo"); } public String getHelpText() { return LocStrings.stub("HelpInfo"); }
@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)
@@ -24,7 +24,7 @@ public class CommandHelp extends Command
if(help == null) if(help == null)
{ {
help = LocStrings.Stub("HelpDisplay"); help = LocStrings.stub("HelpDisplay");
} }
else else
{ {
+1 -1
View File
@@ -26,7 +26,7 @@ public class CommandHelpBuilder extends Command {
} }
@Override @Override
public String getHelpText() { return LocStrings.Stub("HelpBuilderInfo"); } public String getHelpText() { return LocStrings.stub("HelpBuilderInfo"); }
@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)
+2 -2
View File
@@ -15,11 +15,11 @@ public class CommandInfo extends Command
public CommandInfo(KittyRole level, KittyRating rating) { super(level, rating); } public CommandInfo(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("InfoInfo"); } public String getHelpText() { return LocStrings.stub("InfoInfo"); }
@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.Call(LocStrings.stub("InfoResponse"));
} }
} }
+1 -1
View File
@@ -10,7 +10,7 @@ public class CommandInvite extends Command
public CommandInvite(KittyRole level, KittyRating rating) { super(level, rating); } public CommandInvite(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("InviteInfo"); } public String getHelpText() { return LocStrings.stub("InviteInfo"); }
@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)
+2 -2
View File
@@ -12,14 +12,14 @@ public class CommandJDoodle extends Command
public CommandJDoodle(KittyRole level, KittyRating rating) { super(level, rating); } public CommandJDoodle(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("JDoodleInfo"); } public String getHelpText() { return LocStrings.stub("JDoodleInfo"); }
@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)
{ {
if(input.args.trim().length() < 1) if(input.args.trim().length() < 1)
{ {
res.Call(LocStrings.Stub("JDoodleError")); res.Call(LocStrings.stub("JDoodleError"));
return; return;
} }
+6 -6
View File
@@ -23,7 +23,7 @@ public class CommandMap extends Command
public CommandMap(KittyRole roleLevel, KittyRating contentRating) { super(roleLevel, contentRating); } public CommandMap(KittyRole roleLevel, KittyRating contentRating) { super(roleLevel, contentRating); }
@Override @Override
public String getHelpText() { return String.format(LocStrings.Stub("MapInfo"), "" + MaxWidth, "" + MaxHeight); } public String getHelpText() { return String.format(LocStrings.stub("MapInfo"), "" + MaxWidth, "" + MaxHeight); }
@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)
@@ -60,7 +60,7 @@ public class CommandMap extends Command
} }
catch(NumberFormatException e) catch(NumberFormatException e)
{ {
res.Call(LocStrings.Stub("MapInvalid")); res.Call(LocStrings.stub("MapInvalid"));
return; return;
} }
@@ -76,10 +76,10 @@ public class CommandMap extends Command
} }
// Response header creation // Response header creation
header += LocStrings.Stub("MapVersion") + "\n"; header += LocStrings.stub("MapVersion") + "\n";
header += LocStrings.Stub("MapSeed") + ": `" + seed + "`, "; header += LocStrings.stub("MapSeed") + ": `" + seed + "`, ";
header += LocStrings.Stub("MapWidth") + "`"+ width +"`, "; header += LocStrings.stub("MapWidth") + "`"+ width +"`, ";
header += LocStrings.Stub("MapHeight") + ": `"+ height + "`\n"; header += LocStrings.stub("MapHeight") + ": `"+ height + "`\n";
// Response body creation // Response body creation
body += "```\n"; body += "```\n";
+1 -1
View File
@@ -23,7 +23,7 @@ public class CommandPerish extends Command
public CommandPerish(KittyRole level, KittyRating rating) { super(level, rating); } public CommandPerish(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("PerishInfo"); }; public String getHelpText() { return LocStrings.stub("PerishInfo"); };
private static Long num = 0l; private static Long num = 0l;
+2 -2
View File
@@ -15,12 +15,12 @@ public class CommandPing extends Command
public CommandPing(KittyRole level, KittyRating rating) { super(level, rating); } public CommandPing(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("PingInfo"); } public String getHelpText() { return LocStrings.stub("PingInfo"); }
// Called when the command is run! // Called when the command is run!
@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.Call(LocStrings.stub("PingResponse"));
} }
} }
+1 -1
View File
@@ -14,7 +14,7 @@ public class CommandPollManage extends Command
public CommandPollManage(KittyRole level, KittyRating rating) { super(level, rating); } public CommandPollManage(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("PollManageInfo"); } public String getHelpText() { return LocStrings.stub("PollManageInfo"); }
@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)
+2 -2
View File
@@ -10,7 +10,7 @@ public class CommandPollResults extends Command
public CommandPollResults(KittyRole level, KittyRating rating) { super(level, rating); } public CommandPollResults(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("PollResultsInfo"); } public String getHelpText() { return LocStrings.stub("PollResultsInfo"); }
@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)
@@ -28,7 +28,7 @@ public class CommandPollResults extends Command
for(int i = 0; i < votes.size(); i++) for(int i = 0; i < votes.size(); i++)
{ {
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.Call(results);
+4 -4
View File
@@ -8,18 +8,18 @@ public class CommandPollShow extends Command
public CommandPollShow(KittyRole level, KittyRating rating) { super(level, rating); } public CommandPollShow(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("PollShowInfo"); } public String getHelpText() { return LocStrings.stub("PollShowInfo"); }
@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)
{ {
if(!guild.polling) if(!guild.polling)
{ {
res.Call(LocStrings.Stub("PollShowNoPoll")); res.Call(LocStrings.stub("PollShowNoPoll"));
return; return;
} }
String poll = String.format(LocStrings.Stub("PollShowPoll"), guild.poll); String poll = String.format(LocStrings.stub("PollShowPoll"), guild.poll);
poll += LocStrings.Stub("PollShowChoices"); poll += LocStrings.stub("PollShowChoices");
for(int i = 0; i < guild.choices.size(); i++) for(int i = 0; i < guild.choices.size(); i++)
{ {
poll += (i+1) + ": `" + guild.choices.get(i).choice + "`\n"; poll += (i+1) + ": `" + guild.choices.get(i).choice + "`\n";
+6 -6
View File
@@ -8,7 +8,7 @@ public class CommandPollVote extends Command
public CommandPollVote(KittyRole level, KittyRating rating) { super(level, rating); } public CommandPollVote(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("PollVoteInfo"); } public String getHelpText() { return LocStrings.stub("PollVoteInfo"); }
@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)
@@ -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.Call(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.Call(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.Call(LocStrings.stub("PollVoteSuccess") + " `" + polled.choice + "`!");
return; return;
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
res.Call(LocStrings.Stub("PollVoteNotValidNumber")); res.Call(LocStrings.stub("PollVoteNotValidNumber"));
return; return;
} }
} }
res.Call(LocStrings.Stub("PollVoteNoPoll")); res.Call(LocStrings.stub("PollVoteNoPoll"));
} }
} }
+3 -3
View File
@@ -14,7 +14,7 @@ public class CommandRPEnd extends Command
public CommandRPEnd (KittyRole level, KittyRating rating) { super(level, rating); } public CommandRPEnd (KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("RPEndInfo"); } public String getHelpText() { return LocStrings.stub("RPEndInfo"); }
@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)
@@ -33,11 +33,11 @@ public class CommandRPEnd extends Command
if(sending != null) if(sending != null)
{ {
res.CallFile(sending, "txt"); res.CallFile(sending, "txt");
res.Call(LocStrings.Stub("RPEndFileOut")); res.Call(LocStrings.stub("RPEndFileOut"));
} }
else else
{ {
res.Call(LocStrings.Stub("RPEndError")); res.Call(LocStrings.stub("RPEndError"));
} }
} }
} }
+2 -2
View File
@@ -23,7 +23,7 @@ public class CommandRPG extends Command
} }
@Override @Override
public String getHelpText() { return LocStrings.Stub("RPGInfo"); }; public String getHelpText() { return LocStrings.stub("RPGInfo"); };
@Override @Override
@@ -44,7 +44,7 @@ public class CommandRPG extends Command
if(result == null) if(result == null)
{ {
res.Call(LocStrings.Stub("RPGInvalid")); res.Call(LocStrings.stub("RPGInvalid"));
return; return;
} }
+1 -1
View File
@@ -12,7 +12,7 @@ public class CommandRPStart extends Command
public CommandRPStart (KittyRole level, KittyRating rating) { super(level, rating); } public CommandRPStart (KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("RPStartInfo"); } public String getHelpText() { return LocStrings.stub("RPStartInfo"); }
@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)
+3 -3
View File
@@ -15,18 +15,18 @@ public class CommandRaffleEnd extends Command
public CommandRaffleEnd(KittyRole level, KittyRating rating) { super(level, rating); } public CommandRaffleEnd(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("RaffleEndInfo"); } public String getHelpText() { return LocStrings.stub("RaffleEndInfo"); }
@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)
{ {
if(guild.endRaffle()) if(guild.endRaffle())
{ {
res.Call(LocStrings.Stub("RaffleEndSuccess")); res.Call(LocStrings.stub("RaffleEndSuccess"));
} }
else else
{ {
res.Call(LocStrings.Stub("RaffleEndFailure")); res.Call(LocStrings.stub("RaffleEndFailure"));
} }
} }
} }
+3 -3
View File
@@ -15,18 +15,18 @@ public class CommandRaffleJoin extends Command
public CommandRaffleJoin(KittyRole level, KittyRating rating) { super(level, rating); } public CommandRaffleJoin(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("RaffleJoinInfo"); } public String getHelpText() { return LocStrings.stub("RaffleJoinInfo"); }
@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)
{ {
if(guild.joinRaffle(user)) if(guild.joinRaffle(user))
{ {
res.Call(LocStrings.Stub("RaffleJoinSuccess")); res.Call(LocStrings.stub("RaffleJoinSuccess"));
} }
else else
{ {
res.Call(LocStrings.Stub("RaffleJoinFailure")); res.Call(LocStrings.stub("RaffleJoinFailure"));
} }
} }
} }
+3 -3
View File
@@ -15,18 +15,18 @@ public class CommandRaffleSpin extends Command
public CommandRaffleSpin(KittyRole level, KittyRating rating) { super(level, rating); } public CommandRaffleSpin(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("RaffleSpinInfo"); } public String getHelpText() { return LocStrings.stub("RaffleSpinInfo"); }
@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)
{ {
try try
{ {
res.Call(String.format(LocStrings.Stub("RaffleSpinSuccess"), guild.chooseRaffleWinner().name)); res.Call(String.format(LocStrings.stub("RaffleSpinSuccess"), guild.chooseRaffleWinner().name));
} }
catch(Exception e) catch(Exception e)
{ {
res.Call(LocStrings.Stub("RaffleSpinFailure")); res.Call(LocStrings.stub("RaffleSpinFailure"));
} }
} }
} }
+3 -3
View File
@@ -15,7 +15,7 @@ public class CommandRaffleStart extends Command
public CommandRaffleStart(KittyRole level, KittyRating rating) { super(level, rating); } public CommandRaffleStart(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("RaffleStartInfo"); } public String getHelpText() { return LocStrings.stub("RaffleStartInfo"); }
public int beanCost; public int beanCost;
@@ -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.Call(String.format(LocStrings.stub("RaffleStartSuccess"), beanCost));
} }
else else
{ {
res.Call(LocStrings.Stub("RaffleStartFailure")); res.Call(LocStrings.stub("RaffleStartFailure"));
} }
} }
} }
+4 -4
View File
@@ -15,7 +15,7 @@ public class CommandRating extends Command
public CommandRating(KittyRole level, KittyRating rating) { super(level, rating); } public CommandRating(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("RatingInfo"); } public String getHelpText() { return LocStrings.stub("RatingInfo"); }
// Called when the command is run! // Called when the command is run!
@Override @Override
@@ -55,11 +55,11 @@ public class CommandRating extends Command
} }
if(newRating != null) if(newRating != null)
res.Call(LocStrings.Stub("RatingChanged") + " " + newRating); res.Call(LocStrings.stub("RatingChanged") + " " + newRating);
else else
res.Call(LocStrings.Stub("RatingInvalid") + " `" + input.args + "`"); res.Call(LocStrings.stub("RatingInvalid") + " `" + input.args + "`");
if(newRating.equals("Filtered")) if(newRating.equals("Filtered"))
res.Call(LocStrings.Stub("RatingWarning")); res.Call(LocStrings.stub("RatingWarning"));
} }
} }
+5 -5
View File
@@ -9,20 +9,20 @@ public class CommandRole extends Command
public CommandRole (KittyRole level, KittyRating rating) { super(level, rating); } public CommandRole (KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("RoleInfo"); } public String getHelpText() { return LocStrings.stub("RoleInfo"); }
@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)
{ {
if(input.args.isEmpty()) if(input.args.isEmpty())
{ {
res.Call(LocStrings.Stub("RoleStandardResponse") + " " + user.GetRole().name() + "!"); res.Call(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.Call(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.Call(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.Call(String.format(LocStrings.stub("RoleChanged"), users, newRole.name()));
} }
} }
+2 -2
View File
@@ -16,7 +16,7 @@ public class CommandRoll extends Command
public CommandRoll(KittyRole level, KittyRating rating) { super(level, rating); } public CommandRoll(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("RollInfo"); } public String getHelpText() { return LocStrings.stub("RollInfo"); }
@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)
@@ -27,7 +27,7 @@ public class CommandRoll extends Command
} }
catch(Exception e) catch(Exception e)
{ {
res.Call(LocStrings.Stub("RollError")); res.Call(LocStrings.stub("RollError"));
} }
} }
+3 -3
View File
@@ -20,7 +20,7 @@ public class CommandShutdown extends Command
public CommandShutdown(KittyRole level, KittyRating rating) { super(level, rating); } public CommandShutdown(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("ShutdownInfo"); } public String getHelpText() { return LocStrings.stub("ShutdownInfo"); }
// Called when the command is run! // Called when the command is run!
@Override @Override
@@ -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.CallImmediate(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.CallImmediate(LocStrings.stub("ShutdownUnsafe"));// "``");
GlobalLog.Warn(LogFilter.Command, LocStrings.Lookup("ShutdownSafe")); GlobalLog.Warn(LogFilter.Command, LocStrings.Lookup("ShutdownSafe"));
System.exit(0); System.exit(0);
} }
+1 -1
View File
@@ -17,7 +17,7 @@ public class CommandStark extends Command
public CommandStark(KittyRole level, KittyRating rating) { super(level, rating); } public CommandStark(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("StarkInfo"); }; public String getHelpText() { return LocStrings.stub("StarkInfo"); };
private static Long num = 0l; private static Long num = 0l;
+1 -1
View File
@@ -17,7 +17,7 @@ public class CommandStats extends Command
public CommandStats(KittyRole level, KittyRating rating) { super(level, rating); } public CommandStats(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("StatsInfo"); } public String getHelpText() { return LocStrings.stub("StatsInfo"); }
// Called when the command is run! // Called when the command is run!
@Override @Override
+1 -1
View File
@@ -23,7 +23,7 @@ public class CommandTeey extends Command
private static Long num = 0l; private static Long num = 0l;
@Override @Override
public String getHelpText() { return LocStrings.Stub("TeeyInfo"); } public String getHelpText() { return LocStrings.stub("TeeyInfo"); }
// Called when the command is run! // Called when the command is run!
@Override @Override
+6 -6
View File
@@ -15,14 +15,14 @@ public class CommandTradeBeans extends Command
public CommandTradeBeans(KittyRole level, KittyRating rating) { super(level, rating); } public CommandTradeBeans(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("TradeBeansInfo"); } public String getHelpText() { return LocStrings.stub("TradeBeansInfo"); }
@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)
{ {
if(input.mentions == null) if(input.mentions == null)
{ {
res.Call(LocStrings.Stub("TradeBeansNoTargetError")); res.Call(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.Call(LocStrings.stub("TradeBeansIntParseError"));
return; return;
} }
if(user.GetBeans() < beans) if(user.GetBeans() < beans)
{ {
res.Call(LocStrings.Stub("TradeBeansNotEnoughError")); res.Call(LocStrings.stub("TradeBeansNotEnoughError"));
return; return;
} }
if(beans < 0) if(beans < 0)
{ {
res.Call(String.format(LocStrings.Stub("TradeBeansStealingBeans"), user.name)); res.Call(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.Call(String.format(LocStrings.stub("TradeBeansSuccess"), user.name, input.mentions[0].name, beans));
} }
} }
+2 -2
View File
@@ -11,7 +11,7 @@ public class CommandTweet extends Command
public CommandTweet(KittyRole level, KittyRating rating) { super(level, rating); } public CommandTweet(KittyRole level, KittyRating rating) { super(level, rating); }
@Override @Override
public String getHelpText() { return LocStrings.Stub("TweetInfo"); } public String getHelpText() { return LocStrings.stub("TweetInfo"); }
@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)
@@ -20,7 +20,7 @@ public class CommandTweet extends Command
try { try {
res.Call(tweet.tweet(input.args)); res.Call(tweet.tweet(input.args));
} catch (Exception e) { } catch (Exception e) {
res.Call(LocStrings.Stub("TweetError")); res.Call(LocStrings.stub("TweetError"));
} }
} }
} }
+3 -3
View File
@@ -15,13 +15,13 @@ public class CommandWolfram extends Command
public CommandWolfram(KittyRole level, KittyRating rating) { super(level, rating);} public CommandWolfram(KittyRole level, KittyRating rating) { super(level, rating);}
@Override @Override
public String getHelpText() { return LocStrings.Stub("WolframInfo"); } public String getHelpText() { return LocStrings.stub("WolframInfo"); }
@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)
{ {
if(input.args == null || input.args.trim().length() == 0) if(input.args == null || input.args.trim().length() == 0)
res.Call(LocStrings.Stub("WolframNoArgs")); res.Call(LocStrings.stub("WolframNoArgs"));
try try
{ {
@@ -31,7 +31,7 @@ public class CommandWolfram extends Command
} }
catch (IOException e) catch (IOException e)
{ {
res.Call(LocStrings.Stub("WolframError")); res.Call(LocStrings.stub("WolframError"));
} }
} }
} }
+1 -1
View File
@@ -23,7 +23,7 @@ public class CommandYeet extends Command
private static Long num = 0l; private static Long num = 0l;
@Override @Override
public String getHelpText() { return LocStrings.Stub("YeetInfo"); } public String getHelpText() { return LocStrings.stub("YeetInfo"); }
// Called when the command is run! // Called when the command is run!
@Override @Override
+2 -2
View File
@@ -11,7 +11,7 @@ import dataStructures.Pair;
public class LocCommands extends BaseLocFile public class LocCommands extends BaseLocFile
{ {
public static final String fileName = "locCommands.config"; public static final String fileName = "locCommands.config";
public static final String function = "LocCommands.Stub"; public static final String function = "LocCommands.stub";
private static LocCommands instance; private static LocCommands instance;
@@ -38,7 +38,7 @@ public class LocCommands extends BaseLocFile
} }
// Returns a pair, the raw key and the stub key // Returns a pair, the raw key and the stub key
public static Pair<String, String> Stub(String toStub) public static Pair<String, String> stub(String toStub)
{ {
return new Pair<String, String>(toStub, instance.GetKey(toStub)); return new Pair<String, String>(toStub, instance.GetKey(toStub));
} }
+2 -2
View File
@@ -10,7 +10,7 @@ import utils.io.FileMonitor;
public class LocStrings extends BaseLocFile public class LocStrings extends BaseLocFile
{ {
public static final String fileName = "locStrings.config"; public static final String fileName = "locStrings.config";
public static final String function = "LocStrings.Stub"; public static final String function = "LocStrings.stub";
private static LocStrings instance; private static LocStrings instance;
@@ -36,7 +36,7 @@ public class LocStrings extends BaseLocFile
} }
} }
public static String Stub(String toStub) public static String stub(String toStub)
{ {
return Lookup(toStub); return Lookup(toStub);
} }
+51 -51
View File
@@ -337,63 +337,63 @@ public class ObjectBuilderFactory
CommandManager manager = new CommandManager(commandEnabler); CommandManager manager = new CommandManager(commandEnabler);
// Dev // Dev
manager.Register(LocCommands.Stub("work"), new CommandDoWork(KittyRole.Dev, KittyRating.Safe)); manager.Register(LocCommands.stub("work"), new CommandDoWork(KittyRole.Dev, KittyRating.Safe));
manager.Register(LocCommands.Stub("shutdown"), new CommandShutdown(KittyRole.Dev, KittyRating.Safe)); manager.Register(LocCommands.stub("shutdown"), new CommandShutdown(KittyRole.Dev, KittyRating.Safe));
manager.Register(LocCommands.Stub("stats"), new CommandStats(KittyRole.Dev, KittyRating.Safe)); manager.Register(LocCommands.stub("stats"), new CommandStats(KittyRole.Dev, KittyRating.Safe));
manager.Register(LocCommands.Stub("invite"), new CommandInvite(KittyRole.Dev, KittyRating.Safe)); manager.Register(LocCommands.stub("invite"), new CommandInvite(KittyRole.Dev, KittyRating.Safe));
manager.Register(LocCommands.Stub("buildHelp"), new CommandHelpBuilder(KittyRole.Dev, KittyRating.Safe)); manager.Register(LocCommands.stub("buildHelp"), new CommandHelpBuilder(KittyRole.Dev, KittyRating.Safe));
manager.Register(LocCommands.Stub("tweet"), new CommandTweet(KittyRole.Dev, KittyRating.Safe)); manager.Register(LocCommands.stub("tweet"), new CommandTweet(KittyRole.Dev, KittyRating.Safe));
manager.Register(LocCommands.Stub("dbflush"), new CommandDBFlush(KittyRole.Dev, KittyRating.Safe)); manager.Register(LocCommands.stub("dbflush"), new CommandDBFlush(KittyRole.Dev, KittyRating.Safe));
manager.Register(LocCommands.Stub("dbstats"), new CommandDBStats(KittyRole.Dev, KittyRating.Safe)); manager.Register(LocCommands.stub("dbstats"), new CommandDBStats(KittyRole.Dev, KittyRating.Safe));
// Admin // Admin
manager.Register(LocCommands.Stub("rating"), new CommandRating(KittyRole.Admin, KittyRating.Safe)); manager.Register(LocCommands.stub("rating"), new CommandRating(KittyRole.Admin, KittyRating.Safe));
manager.Register(LocCommands.Stub("indicator"), new CommandChangeIndicator(KittyRole.Admin, KittyRating.Safe)); manager.Register(LocCommands.stub("indicator"), new CommandChangeIndicator(KittyRole.Admin, KittyRating.Safe));
manager.Register(LocCommands.Stub("guildroleallowed"), new CommandGuildRoleAllowed(KittyRole.Admin, KittyRating.Safe)); manager.Register(LocCommands.stub("guildroleallowed"), new CommandGuildRoleAllowed(KittyRole.Admin, KittyRating.Safe));
manager.Register(LocCommands.Stub("guildrolenotallowed"), new CommandGuildRoleNotAllowed(KittyRole.Admin, KittyRating.Safe)); manager.Register(LocCommands.stub("guildrolenotallowed"), new CommandGuildRoleNotAllowed(KittyRole.Admin, KittyRating.Safe));
// Mod // Mod
manager.Register(LocCommands.Stub("poll"), new CommandPollManage(KittyRole.Mod, KittyRating.Safe)); manager.Register(LocCommands.stub("poll"), new CommandPollManage(KittyRole.Mod, KittyRating.Safe));
manager.Register(LocCommands.Stub("givebeans"), new CommandGiveBeans(KittyRole.Mod, KittyRating.Safe)); manager.Register(LocCommands.stub("givebeans"), new CommandGiveBeans(KittyRole.Mod, KittyRating.Safe));
manager.Register(LocCommands.Stub("rpg"), new CommandRPG(KittyRole.Mod, KittyRating.Safe)); manager.Register(LocCommands.stub("rpg"), new CommandRPG(KittyRole.Mod, KittyRating.Safe));
manager.Register(LocCommands.Stub("rafflestart"), new CommandRaffleStart(KittyRole.Mod, KittyRating.Safe)); manager.Register(LocCommands.stub("rafflestart"), new CommandRaffleStart(KittyRole.Mod, KittyRating.Safe));
manager.Register(LocCommands.Stub("rafflespin"), new CommandRaffleSpin(KittyRole.Mod, KittyRating.Safe)); manager.Register(LocCommands.stub("rafflespin"), new CommandRaffleSpin(KittyRole.Mod, KittyRating.Safe));
manager.Register(LocCommands.Stub("raffleend"), new CommandRaffleEnd(KittyRole.Mod, KittyRating.Safe)); manager.Register(LocCommands.stub("raffleend"), new CommandRaffleEnd(KittyRole.Mod, KittyRating.Safe));
// General // General
manager.Register(LocCommands.Stub("fetch"), new CommandFetch(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("fetch"), new CommandFetch(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("guildroleadd"), new CommandGuildRoleAdd(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("guildroleadd"), new CommandGuildRoleAdd(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("guildroleremove"), new CommandGuildRoleRemove(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("guildroleremove"), new CommandGuildRoleRemove(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("teey"), new CommandTeey(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("teey"), new CommandTeey(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("perish, thenperish"), new CommandPerish(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("perish, thenperish"), new CommandPerish(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("yeet"), new CommandYeet(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("yeet"), new CommandYeet(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("ping"), new CommandPing(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("ping"), new CommandPing(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("boop"), new CommandBoop(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("boop"), new CommandBoop(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("roll"), new CommandRoll(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("roll"), new CommandRoll(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("choose"), new CommandChoose(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("choose"), new CommandChoose(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("help"), new CommandHelp(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("help"), new CommandHelp(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("info, about"), new CommandInfo(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("info, about"), new CommandInfo(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("vote"), new CommandPollVote(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("vote"), new CommandPollVote(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("results"), new CommandPollResults(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("results"), new CommandPollResults(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("showpoll"), new CommandPollShow(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("showpoll"), new CommandPollShow(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("wolfram"), new CommandWolfram(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("wolfram"), new CommandWolfram(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("c++, g++, cplus, cpp"), new CommandColiru(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("c++, g++, cplus, cpp"), new CommandColiru(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("java, jdoodle"), new CommandJDoodle(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("java, jdoodle"), new CommandJDoodle(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("beans"), new CommandBeansShow(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("beans"), new CommandBeansShow(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("role"), new CommandRole(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("role"), new CommandRole(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("bet"), new CommandBetBeans(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("bet"), new CommandBetBeans(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("map"), new CommandMap(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("map"), new CommandMap(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("rpstart"), new CommandRPStart(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("rpstart"), new CommandRPStart(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("rpend"), new CommandRPEnd(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("rpend"), new CommandRPEnd(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("tony, stark, dontfeelgood, dontfeelsogood"), new CommandStark(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("tony, stark, dontfeelgood, dontfeelsogood"), new CommandStark(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("blur"), new CommandBlurry(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("blur"), new CommandBlurry(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("eightball, 8ball"), new CommandEightBall(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("eightball, 8ball"), new CommandEightBall(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("catch"), new CommandCatch(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("catch"), new CommandCatch(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("guildrolelist"), new CommandGuildRoleList(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("guildrolelist"), new CommandGuildRoleList(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("bethistory"), new CommandBetHistory(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("bethistory"), new CommandBetHistory(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("crouton"), new CommandCrouton(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("crouton"), new CommandCrouton(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("benchmark, bench"), new CommandBenchmark(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("benchmark, bench"), new CommandBenchmark(KittyRole.General, KittyRating.Safe));
manager.Register(LocCommands.Stub("rafflejoin"), new CommandRaffleJoin(KittyRole.General, KittyRating.Safe)); manager.Register(LocCommands.stub("rafflejoin"), new CommandRaffleJoin(KittyRole.General, KittyRating.Safe));
return manager; return manager;
} }