Generalized Localizer File
This commit is contained in:
@@ -9,11 +9,11 @@ public class CommandBeansShow extends Command
|
||||
public CommandBeansShow(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Displays how many beans you have"); };
|
||||
public String HelpText() { return Localizer.Stub("BeansShowInfo"); };
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
res.Call(String.format(Localizer.Stub("You have %s beans!"), user.GetBeans()));
|
||||
res.Call(String.format(Localizer.Stub("BeansShowDisplay"), user.GetBeans()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package commands;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import core.Command;
|
||||
import core.Localizer;
|
||||
import dataStructures.*;
|
||||
@@ -9,7 +11,7 @@ public class CommandBetBeans extends Command
|
||||
public CommandBetBeans(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Allows you to bet your beans, set your amount after the command! Warning! House always wins!\nSets of 3 will get 5x, 4 will get 10x, and 5 will get 1000x"); }
|
||||
public String HelpText() { return Localizer.Stub("BetBeansInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -22,19 +24,19 @@ public class CommandBetBeans extends Command
|
||||
bet = Integer.parseInt(input.args);
|
||||
if(bet < 50)
|
||||
{
|
||||
res.Call(Localizer.Stub("Please bet with at least 50 beans!"));
|
||||
res.Call(Localizer.Stub("BetBeansLowBet"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
res.Call(Localizer.Stub("That's not a valid bet!"));
|
||||
res.Call(Localizer.Stub("BetBeansNotValid"));
|
||||
return;
|
||||
}
|
||||
|
||||
if(user.GetBeans() < bet)
|
||||
{
|
||||
res.Call(Localizer.Stub("You don't have enough beans!"));
|
||||
res.Call(Localizer.Stub("BetBeansNotEnough"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -49,12 +51,12 @@ public class CommandBetBeans extends Command
|
||||
|
||||
if(win == 0)
|
||||
{
|
||||
res.Call(Localizer.Stub("Sorry, you didn't win, try again!"));
|
||||
res.Call(Localizer.Stub("BetBeansLose"));
|
||||
return;
|
||||
}
|
||||
|
||||
user.ChangeBeans(bet*win);
|
||||
res.Call(String.format(Localizer.Stub("You won %s beans!"), "" + (bet*win)));
|
||||
res.Call(String.format(Localizer.Stub("BetBeansWin"), "" + (bet*win)));
|
||||
}
|
||||
|
||||
private int getWinning(int [] slots)
|
||||
@@ -69,7 +71,7 @@ public class CommandBetBeans extends Command
|
||||
counter = 1;
|
||||
|
||||
if(counter == 3)
|
||||
winning = 5;
|
||||
winning = 2;
|
||||
|
||||
if(counter == 4)
|
||||
winning = 10;
|
||||
@@ -83,10 +85,12 @@ public class CommandBetBeans extends Command
|
||||
|
||||
private int[] getSlots()
|
||||
{
|
||||
Random gen = new Random();
|
||||
int[] nums = new int[5];
|
||||
for (int i = 0; i < nums.length; i++)
|
||||
{
|
||||
nums[i] = (int) (Math.random() * 5) + 1;
|
||||
nums[i] = Math.abs(gen.nextInt() % 7) + 1;
|
||||
System.out.println(nums [i]);
|
||||
}
|
||||
return nums;
|
||||
}
|
||||
@@ -138,6 +142,12 @@ public class CommandBetBeans extends Command
|
||||
case 5:
|
||||
slotHearts += ":purple_heart:";
|
||||
break;
|
||||
case 6:
|
||||
slotHearts += ":black_heart:";
|
||||
break;
|
||||
case 7:
|
||||
slotHearts += ":broken_heart:";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public class CommandBlurry extends Command
|
||||
public CommandBlurry(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Blurs your icon or the icon of a friend you mentioned"); };
|
||||
public String HelpText() { return Localizer.Stub("BlurryInfo"); };
|
||||
|
||||
private static Long num = 0l;
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public class CommandBoop extends Command
|
||||
}
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Kitty will react with a counter"); }
|
||||
public String HelpText() { return Localizer.Stub("BoopInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
@@ -69,14 +69,14 @@ public class CommandBoop extends Command
|
||||
if(input.mentions == null)
|
||||
{
|
||||
boopTracker.ApplyBoop();
|
||||
res.Call(String.format(Localizer.Stub("Woah! %s booped me! That's %s total!"), user.name, boopTracker.HowMany()));
|
||||
res.Call(String.format(Localizer.Stub("BoopStandard"), user.name, boopTracker.HowMany()));
|
||||
}
|
||||
else
|
||||
{
|
||||
if(input.mentions.length == 1)
|
||||
{
|
||||
boopTracker.ApplyBoop();
|
||||
res.Call(String.format(Localizer.Stub("%s booped %s!"), user.name, input.mentions[0].name));
|
||||
res.Call(String.format(Localizer.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(Localizer.Stub("%s booped several others - %s!"), user.name, booped));
|
||||
res.Call(String.format(Localizer.Stub("BoopMultiple"), user.name, booped));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ public class CommandChangeIndicator extends Command
|
||||
public CommandChangeIndicator(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Changes the command indicator to any single character. By default, it's '!'. If more than one character is provided, the first one is used!"); }
|
||||
public String HelpText() { return Localizer.Stub("ChangeIndicatorInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -17,11 +17,11 @@ public class CommandChangeIndicator extends Command
|
||||
String arg = input.args.trim();
|
||||
if(arg.length() == 0)
|
||||
{
|
||||
res.Call("Please specify a letter or symbol to use!");
|
||||
res.Call(Localizer.Stub("ChangeIndicatorError"));
|
||||
return;
|
||||
}
|
||||
|
||||
guild.SetCommandIndicator(arg.substring(0, 1));
|
||||
res.Call(String.format(Localizer.Stub("Indicator changed to `%s`"), guild.GetCommandIndicator()));
|
||||
res.Call(String.format(Localizer.Stub("ChangeIndicatorChanged"), guild.GetCommandIndicator()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CommandChoose extends Command
|
||||
public CommandChoose(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("With an input of x,y,z where x y and z are all choices, kitty will choose one"); }
|
||||
public String HelpText() { return Localizer.Stub("ChooseInfo"); }
|
||||
|
||||
@Override
|
||||
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(",");
|
||||
if(choices.length == 1)
|
||||
{
|
||||
res.Call("I can't choose from *one* thing!");
|
||||
res.Call(Localizer.Stub("ChooseOne"));
|
||||
return;
|
||||
}
|
||||
|
||||
res.Call(String.format(Localizer.Stub("I chooooooose %s!"), (choices[(int) (Math.random()*choices.length)]).toString()));
|
||||
res.Call(String.format(Localizer.Stub("ChooseChoice"), (choices[(int) (Math.random()*choices.length)]).toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,14 +12,14 @@ public class CommandColiru extends Command
|
||||
public CommandColiru(KittyRole level, KittyRating rating) { super(level, rating);}
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Will try to compile any c++ code you put in! Supports up to C++14 standard, uses g++."); }
|
||||
public String HelpText() { return Localizer.Stub("ColiruInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(input.args.trim().length() < 1)
|
||||
{
|
||||
res.Call(Localizer.Stub("Please provide some c++ code to attempt to compile!"));
|
||||
res.Call(Localizer.Stub("ColiruError"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class CommandDoWork extends Command
|
||||
public CommandDoWork(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Occupies a core for a few seconds"); }
|
||||
public String HelpText() { return Localizer.Stub("DoWorkInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
@@ -28,6 +28,6 @@ public class CommandDoWork extends Command
|
||||
thispieceofshit += Math.log((double)i);
|
||||
}
|
||||
|
||||
res.Call(Localizer.Stub("I finished with my work! :D"));
|
||||
res.Call(Localizer.Stub("DoWorkFinished"));
|
||||
}
|
||||
}
|
||||
@@ -8,40 +8,40 @@ public class CommandEightBall extends Command
|
||||
{
|
||||
String [] answers =
|
||||
{
|
||||
Localizer.Stub("It is certain.")
|
||||
, Localizer.Stub("It is decidedly so.")
|
||||
, Localizer.Stub("Without a doubt.")
|
||||
, Localizer.Stub("Yes - definitely.")
|
||||
, Localizer.Stub("You may rely on it.")
|
||||
, Localizer.Stub("As I see it, yes.")
|
||||
, Localizer.Stub("Most likely.")
|
||||
, Localizer.Stub("Outlook good.")
|
||||
, Localizer.Stub("Yes.")
|
||||
, Localizer.Stub("Signs point to yes.")
|
||||
Localizer.Stub("EightBallYes1")
|
||||
, Localizer.Stub("EightBallYes2")
|
||||
, Localizer.Stub("EightBallYes3")
|
||||
, Localizer.Stub("EightBallYes4")
|
||||
, Localizer.Stub("EightBallYes5")
|
||||
, Localizer.Stub("EightBallYes6")
|
||||
, Localizer.Stub("EightBallYes7")
|
||||
, Localizer.Stub("EightBallYes8")
|
||||
, Localizer.Stub("EightBallYes9")
|
||||
, Localizer.Stub("EightBallYes10")
|
||||
|
||||
, Localizer.Stub("Reply hazy, try again.")
|
||||
, Localizer.Stub("Ask again later.")
|
||||
, Localizer.Stub("Better not tell you now.")
|
||||
, Localizer.Stub("Cannot predict now.")
|
||||
, Localizer.Stub("Concentrate and ask again.")
|
||||
, Localizer.Stub("EightBallMaybe1")
|
||||
, Localizer.Stub("EightBallMaybe2")
|
||||
, Localizer.Stub("EightBallMaybe3")
|
||||
, Localizer.Stub("EightBallMaybe4")
|
||||
, Localizer.Stub("EightBallMaybe5")
|
||||
|
||||
, Localizer.Stub("Don't count on it.")
|
||||
, Localizer.Stub("My reply is no.")
|
||||
, Localizer.Stub("My sources say no.")
|
||||
, Localizer.Stub("Outlook not so good.")
|
||||
, Localizer.Stub("Very doubtful.")
|
||||
, Localizer.Stub("EightBallNo1")
|
||||
, Localizer.Stub("EightBallNo2")
|
||||
, Localizer.Stub("EightBallNo3")
|
||||
, Localizer.Stub("EightBallNo4")
|
||||
, Localizer.Stub("EightBallNo5")
|
||||
};
|
||||
|
||||
public CommandEightBall(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Answers a yes or no question! Warning: Kitty can not actually tell the future, she claims no responsibility for any lion mauling, lack of lottery wins, or felony charges."); }
|
||||
public String HelpText() { return Localizer.Stub("EightBallInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(input.args.trim().length() < 1)
|
||||
res.Call(Localizer.Stub("Hmm? You'll need to ask a question!"));
|
||||
res.Call(Localizer.Stub("EightBallError"));
|
||||
|
||||
res.Call(answers[(int) (Math.random()*answers.length)]);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ public class CommandGiveBeans extends Command
|
||||
public CommandGiveBeans (KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Gives beans to the mentioned users!"); }
|
||||
public String HelpText() { return Localizer.Stub("GiveBeansInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -20,20 +20,20 @@ public class CommandGiveBeans extends Command
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
res.Call(Localizer.Stub("That's not a valid number!"));
|
||||
res.Call(Localizer.Stub("GiveBeansInvalid"));
|
||||
return;
|
||||
}
|
||||
|
||||
if(input.mentions == null)
|
||||
{
|
||||
res.Call(Localizer.Stub("You didn't mention anyone!"));
|
||||
res.Call(Localizer.Stub("GiveBeansNoneMentioned"));
|
||||
return;
|
||||
}
|
||||
|
||||
for(int i = 0; i < input.mentions.length; i++)
|
||||
{
|
||||
input.mentions[i].ChangeBeans(beans);
|
||||
res.Call(String.format(Localizer.Stub("Gave %s %s beans!"), input.mentions[i].name, "" + beans));
|
||||
res.Call(String.format(Localizer.Stub("GiveBeansSuccess"), input.mentions[i].name, "" + beans));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public class CommandHelp extends Command
|
||||
public CommandHelp(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Lets you look up specific commands, or get a link to a list of all commands."); }
|
||||
public String HelpText() { return Localizer.Stub("HelpInfo"); }
|
||||
|
||||
@Override
|
||||
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)
|
||||
{
|
||||
help = Localizer.Stub("You can get help with a specific command by typing `!help command`!\nGeneral Commands: `boop, roll, choose, help, info, vote, results, showpoll, wolfram, cplus, java, beans, role, bet, yeet`");
|
||||
help = Localizer.Stub("HelpDisplay");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CommandHelpBuilder extends Command {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Emit help for all commands as formatted HTML"); }
|
||||
public String HelpText() { return Localizer.Stub("HelpBuilderInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -96,7 +96,7 @@ public class CommandHelpBuilder extends Command {
|
||||
roleStr = roleStr.substring(0, 1).toUpperCase() + roleStr.toLowerCase().substring(1);
|
||||
|
||||
// Section header
|
||||
accumulated += headerStart + roleStr + " " + Localizer.Stub("commands") + headerEnd;
|
||||
accumulated += headerStart + roleStr + " commands" + headerEnd;
|
||||
accumulated += sectionStart;
|
||||
|
||||
// Section content
|
||||
|
||||
@@ -15,11 +15,11 @@ public class CommandInfo extends Command
|
||||
public CommandInfo(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Provides some extra info about KittyBot"); }
|
||||
public String HelpText() { return Localizer.Stub("InfoInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
res.Call(Localizer.Stub("I'm a Java application written with JDA! Check out my repo at <https://github.com/AlexStewartCode/KittyBot>"));
|
||||
res.Call(Localizer.Stub("InfoResponse"));
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ public class CommandInvite extends Command
|
||||
public CommandInvite(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Provies a direct invite link for KittyBot"); }
|
||||
public String HelpText() { return Localizer.Stub("InviteInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
|
||||
@@ -12,14 +12,14 @@ public class CommandJDoodle extends Command
|
||||
public CommandJDoodle(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Will compile any java code you put in! Supports Java 1.8"); }
|
||||
public String HelpText() { return Localizer.Stub("JDoodleInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(input.args.trim().length() < 1)
|
||||
{
|
||||
res.Call(Localizer.Stub("Please provide some java code to get it compiled!"));
|
||||
res.Call(Localizer.Stub("JDoodleError"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class CommandMap extends Command
|
||||
public CommandMap(KittyRole roleLevel, KittyRating contentRating) { super(roleLevel, contentRating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return String.format(Localizer.Stub("Generates a map! You can pass additional information if you want with the flags `-s<seed> -w<width> -h<height>`. If one of the fields isn't provided, its default will be used. Note that adjusting the width and height impacts the map outcomes.\n\nDefault seed: Random,\nDefault Width: 35(max %s),\nDefault Height: 25(max %s)"), "" + MaxWidth, "" + MaxHeight); }
|
||||
public String HelpText() { return String.format(Localizer.Stub("MapInfo"), "" + MaxWidth, "" + MaxHeight); }
|
||||
|
||||
@Override
|
||||
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)
|
||||
{
|
||||
res.Call(Localizer.Stub("Invalid arguments provided!"));
|
||||
res.Call(Localizer.Stub("MapInvalid"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -76,10 +76,10 @@ public class CommandMap extends Command
|
||||
}
|
||||
|
||||
// Response header creation
|
||||
header += Localizer.Stub("Using mapgen v0.1") + "\n";
|
||||
header += Localizer.Stub("Seed") + ": `" + seed + "`, ";
|
||||
header += Localizer.Stub("Width") + "`"+ width +"`, ";
|
||||
header += Localizer.Stub("Height") + ": `"+ height + "`\n";
|
||||
header += Localizer.Stub("MapVersion") + "\n";
|
||||
header += Localizer.Stub("MapSeed") + ": `" + seed + "`, ";
|
||||
header += Localizer.Stub("MapWidth") + "`"+ width +"`, ";
|
||||
header += Localizer.Stub("MapHeight") + ": `"+ height + "`\n";
|
||||
|
||||
// Response body creation
|
||||
body += "```\n";
|
||||
|
||||
@@ -23,7 +23,7 @@ public class CommandPerish extends Command
|
||||
public CommandPerish(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Adds a red, 'a n g e r y' overlay to your icon or the icon of a friend you mentioned"); };
|
||||
public String HelpText() { return Localizer.Stub("PerishInfo"); };
|
||||
|
||||
private static Long num = 0l;
|
||||
|
||||
|
||||
@@ -15,12 +15,12 @@ public class CommandPing extends Command
|
||||
public CommandPing(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Will respond with Pong!"); }
|
||||
public String HelpText() { return Localizer.Stub("PingInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
res.Call(Localizer.Stub("Pong!"));
|
||||
res.Call(Localizer.Stub("PingResponse"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CommandPollManage extends Command
|
||||
public CommandPollManage(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("'start' will start a new poll with the query of the line you put after, 'choice' will add a choice to the poll, 'stop' will end the poll"); }
|
||||
public String HelpText() { return Localizer.Stub("PollMangeInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
|
||||
@@ -10,7 +10,7 @@ public class CommandPollResults extends Command
|
||||
public CommandPollResults(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Will show current results of a poll and percentages of votes per choice"); }
|
||||
public String HelpText() { return Localizer.Stub("PollResultsInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
@@ -24,9 +24,11 @@ public class CommandPollResults extends Command
|
||||
totalVotes += votes.get(i).votes;
|
||||
}
|
||||
|
||||
results += "The poll was " + guild.poll + "\n";
|
||||
|
||||
for(int i = 0; i < votes.size(); i++)
|
||||
{
|
||||
results += String.format(Localizer.Stub("%s people voted for %s `%s` with `%s%` !\n "), votes.get(i).votes, votes.get(i).choice, (int)(((double)votes.get(i).votes) / ((double)totalVotes) * 100));
|
||||
results += String.format(Localizer.Stub("PollResultsResponse"), votes.get(i).votes, votes.get(i).choice, (int)(((double)votes.get(i).votes) / ((double)totalVotes) * 100));
|
||||
}
|
||||
|
||||
res.Call(results);
|
||||
|
||||
@@ -8,18 +8,18 @@ public class CommandPollShow extends Command
|
||||
public CommandPollShow(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Will show the current poll running"); }
|
||||
public String HelpText() { return Localizer.Stub("PollShowInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(!guild.polling)
|
||||
{
|
||||
res.Call(Localizer.Stub("There is no poll running!"));
|
||||
res.Call(Localizer.Stub("PollShowNoPoll"));
|
||||
return;
|
||||
}
|
||||
String poll = String.format(Localizer.Stub("The current poll is `%s`\n"), guild.poll);
|
||||
poll += Localizer.Stub("And the choices are:\n");
|
||||
String poll = String.format(Localizer.Stub("PollShowPoll"), guild.poll);
|
||||
poll += Localizer.Stub("PollShowChoices");
|
||||
for(int i = 0; i < guild.choices.size(); i++)
|
||||
{
|
||||
poll += (i+1) + ": `" + guild.choices.get(i).choice + "`\n";
|
||||
|
||||
@@ -8,7 +8,7 @@ public class CommandPollVote extends Command
|
||||
public CommandPollVote(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Vote in a poll with the choice number, won't work if no poll is running, you can't change your vote once you have cast it! Be careful!"); }
|
||||
public String HelpText() { return Localizer.Stub("PollVoteInfo"); }
|
||||
|
||||
@Override
|
||||
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))
|
||||
{
|
||||
res.Call(Localizer.Stub("You already voted!"));
|
||||
res.Call(Localizer.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(Localizer.Stub("%s That's not a vaild vote!"), voteNum));
|
||||
res.Call(String.format(Localizer.Stub("PollVoteNotValidVote"), voteNum));
|
||||
return;
|
||||
}
|
||||
|
||||
KittyPoll polled = guild.choices.get(voteNum);
|
||||
polled.votes++;
|
||||
guild.hasVoted.add(user.uniqueID);
|
||||
res.Call(Localizer.Stub("You successfully voted for") + " `" + polled.choice + "`!");
|
||||
res.Call(Localizer.Stub("PollVoteSuccess") + " `" + polled.choice + "`!");
|
||||
return;
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
res.Call(Localizer.Stub("That's not a vaild number!"));
|
||||
res.Call(Localizer.Stub("PollVoteNotValidNumber"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
res.Call(Localizer.Stub("There is no poll running!"));
|
||||
res.Call(Localizer.Stub("PollVoteNoPoll"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CommandRPEnd extends Command
|
||||
public CommandRPEnd (KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Ends RP in channel"); }
|
||||
public String HelpText() { return Localizer.Stub("RPEndInfo"); }
|
||||
|
||||
@Override
|
||||
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)
|
||||
{
|
||||
res.CallFile(sending, "txt");
|
||||
res.Call(Localizer.Stub("Here's your file!"));
|
||||
res.Call(Localizer.Stub("RPEndFileOut"));
|
||||
}
|
||||
else
|
||||
{
|
||||
res.Call(Localizer.Stub("You can't end this RP!"));
|
||||
res.Call(Localizer.Stub("RPEndError"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class CommandRPG extends Command
|
||||
}
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Admin+ command only right now - experimental text RPG! Format is !rpg <rpg command>"); };
|
||||
public String HelpText() { return Localizer.Stub("RPGInfo"); };
|
||||
|
||||
|
||||
@Override
|
||||
@@ -45,7 +45,7 @@ public class CommandRPG extends Command
|
||||
|
||||
if(result == null)
|
||||
{
|
||||
res.Call(Localizer.Stub("Invalid RPG Command!"));
|
||||
res.Call(Localizer.Stub("RPGInvalid"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ public class CommandRPStart extends Command
|
||||
public CommandRPStart (KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Starts an rp, add people to it by mentioning them!"); }
|
||||
public String HelpText() { return Localizer.Stub("RPStartInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
|
||||
@@ -15,7 +15,7 @@ public class CommandRating extends Command
|
||||
public CommandRating(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("'0' is fully sfw (Derpi and e621 searches are disabled), '1' is filtered (kitty auto appends a sfw tag on any searches), '2' is nsfw (any search will go through). Some other words are supported for setting filter as well."); }
|
||||
public String HelpText() { return Localizer.Stub("RatingInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
@@ -55,11 +55,11 @@ public class CommandRating extends Command
|
||||
}
|
||||
|
||||
if(newRating != null)
|
||||
res.Call(Localizer.Stub("Kittybot content set to") + " " + newRating);
|
||||
res.Call(Localizer.Stub("RatingChanged") + " " + newRating);
|
||||
else
|
||||
res.Call(Localizer.Stub("Invalid content rating") + " `" + input.args + "`");
|
||||
res.Call(Localizer.Stub("RatingInvalid") + " `" + input.args + "`");
|
||||
|
||||
if(newRating.equals("Filtered"))
|
||||
res.Call(Localizer.Stub("Warning: NSFW may slip through, images are only based on tags on their respective sites!"));
|
||||
res.Call(Localizer.Stub("RatingWarning"));
|
||||
}
|
||||
}
|
||||
@@ -9,20 +9,20 @@ public class CommandRole extends Command
|
||||
public CommandRole (KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Will show the current role you have, Admins can change others roles with input of 'role x @y' with x being blacklist, general, mod, or admin. Blacklist will not allow the user to interact with kitty anymore, general mod and admin will give the user access to those commands."); }
|
||||
public String HelpText() { return Localizer.Stub("RoleInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(input.args.isEmpty())
|
||||
{
|
||||
res.Call(Localizer.Stub("Your role is") + " " + user.GetRole().name() + "!");
|
||||
res.Call(Localizer.Stub("RoleStandardResponse") + " " + user.GetRole().name() + "!");
|
||||
return;
|
||||
}
|
||||
|
||||
if(user.GetRole().getValue() < KittyRole.Admin.getValue())
|
||||
{
|
||||
res.Call(String.format(Localizer.Stub("You aren't allowed to do that! You must have the KittyRole '%' or higher!"), KittyRole.Admin.toString()));
|
||||
res.Call(String.format(Localizer.Stub("RoleError"), KittyRole.Admin.toString()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class CommandRole extends Command
|
||||
break;
|
||||
|
||||
default:
|
||||
res.Call(Localizer.Stub("Please enter `general`, `mod`, or `admin`!"));
|
||||
res.Call(Localizer.Stub("RoleNeededRole"));
|
||||
return;
|
||||
}
|
||||
String users = "";
|
||||
@@ -56,6 +56,6 @@ public class CommandRole extends Command
|
||||
users += input.mentions[i].name + " ";
|
||||
}
|
||||
|
||||
res.Call(String.format(Localizer.Stub("Changed %s to role `%s`!"), users, newRole.name()));
|
||||
res.Call(String.format(Localizer.Stub("RoleChanged"), users, newRole.name()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CommandRoll extends Command
|
||||
public CommandRoll(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Based on input of xdy where x is number of dice and y is faces kitty will roll that amount of dice, display the individual rolls and total"); }
|
||||
public String HelpText() { return Localizer.Stub("RollInfo"); }
|
||||
|
||||
@Override
|
||||
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)
|
||||
{
|
||||
res.Call(Localizer.Stub("Didn't work ;3;"));
|
||||
res.Call(Localizer.Stub("RollError"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class CommandShutdown extends Command
|
||||
public CommandShutdown(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Stops kitty. `-s` or `safe` as an argument attempts to sync off the database before shutdown."); }
|
||||
public String HelpText() { return Localizer.Stub("ShutdownInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,7 @@ public class CommandStark extends Command
|
||||
public CommandStark(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Snaps your icon or the icon of a friend you mentioned"); };
|
||||
public String HelpText() { return Localizer.Stub("StarkInfo"); };
|
||||
|
||||
private static Long num = 0l;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public class CommandStats extends Command
|
||||
public CommandStats(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Displays the actively running KittyBot application information"); }
|
||||
public String HelpText() { return Localizer.Stub("StatsInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,7 @@ public class CommandTeey extends Command
|
||||
private static Long num = 0l;
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Teey yourself back into existance, or teey a friend with @!"); }
|
||||
public String HelpText() { return Localizer.Stub("TeeyInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
|
||||
@@ -11,15 +11,16 @@ public class CommandTweet extends Command
|
||||
public CommandTweet(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("With an input of x,y,z where x y and z are all choices, kitty will choose one"); }
|
||||
public String HelpText() { return Localizer.Stub("TweetInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
//TODO: Figure out how to pass pictures correctly
|
||||
try {
|
||||
res.Call(tweet.tweet(input.args));
|
||||
} catch (Exception e) {
|
||||
res.Call(Localizer.Stub("Tweet command failed!"));
|
||||
res.Call(Localizer.Stub("TweetError"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,13 +15,13 @@ public class CommandWolfram extends Command
|
||||
public CommandWolfram(KittyRole level, KittyRating rating) { super(level, rating);}
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Will query wolframalpha with your question and give a full image output of the answer"); }
|
||||
public String HelpText() { return Localizer.Stub("WolframInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(input.args == null || input.args.trim().length() == 0)
|
||||
res.Call(Localizer.Stub("You need to provide some arguments!"));
|
||||
res.Call(Localizer.Stub("WolframNoArgs"));
|
||||
|
||||
try
|
||||
{
|
||||
@@ -31,7 +31,7 @@ public class CommandWolfram extends Command
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
res.Call(Localizer.Stub("Something went wrong!"));
|
||||
res.Call(Localizer.Stub("WolframError"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class CommandYeet extends Command
|
||||
private static Long num = 0l;
|
||||
|
||||
@Override
|
||||
public String HelpText() { return Localizer.Stub("Yeet yourself or yeet a friend with @!"); }
|
||||
public String HelpText() { return Localizer.Stub("YeetInfo"); }
|
||||
|
||||
// Called when the command is run!
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user