Merge remote-tracking branch 'origin/develop' into feature/collapsed_configs

This commit is contained in:
Matthew Cech
2019-06-30 00:24:05 -07:00
71 changed files with 798 additions and 244 deletions
+66
View File
@@ -0,0 +1,66 @@
[CommandEnabler]
addguildrole=1
allowedguildrole=1
beans=1
benchmark, bench=1
bet=1
bethistory=1
blur=1
boop=1
buildhelp=1
c++, g++, cplus, cpp=1
catch=1
charactercreate=1
charactereditbio=1
charactereditname=1
characterediturl=1
choose=1
color, colour=1
crouton=1
dbflush=1
dbstats=1
defaultdance=1
derp=1
e621=1
eightball, 8ball=1
fetch=1
givebeans=1
guildroleadd=1
guildroleallowed=1
guildrolelist=1
guildrolenotallowed=1
guildroleremove=1
help=1
indicator=1
info, about=1
invite=1
java, jdoodle=1
kittyrole=1
leaderboard=1
map=1
perish, thenperish=1
ping=1
poll=1
raffleend=1
rafflejoin=1
rafflespin=1
rafflestart=1
rating=1
remind=1
results=1
role=1
roll=1
rpend=1
rpg=1
rpstart=1
searchcharacter=1
showpoll=1
shutdown=1
stats=1
teey=1
tony, stark, dontfeelgood, dontfeelsogood=1
tweet=1
vote=1
wolfram=1
work=1
yeet=1
+66
View File
@@ -0,0 +1,66 @@
[ObjectBuilderFactory]
indicator=
yeet=
guildroleremove=
bethistory=
benchmark, bench=
rating=
poll=
rafflespin=
charactereditURL=
bet=
guildrolelist=
stats=
catch=
color, colour=
guildroleadd=
results=
wolfram=
givebeans=
c++, g++, cplus, cpp=
work=
rpend=
java, jdoodle=
rafflejoin=
guildroleallowed=
leaderboard=
buildHelp=
dbflush=
shutdown=
boop=
tony, stark, dontfeelgood, dontfeelsogood=tony, stark, dontfeelgood, dontfeelsogood, snap
role=
raffleend=
ping=
charactereditbio=
roll=
kittyrole=
blur=
choose=
rpstart=
guildrolenotallowed=guildrolenotallowed, rolelistremove
remind=
derp=
perish, thenperish=
teey=
searchcharacter=
dbstats=
rafflestart=
beans=
eightball, 8ball=
vote=
map=
info, about=
e621=
showpoll=
rpg=
defaultdance=
tweet=
charactercreate=
help=
charactereditname=
fetch=
crouton=
invite=
+301
View File
@@ -0,0 +1,301 @@
[CommandBenchmark]
BenchmarkInfo=
BenchmarkInvalid=
[CommandBetHistory]
BetHistoryOutput=
BetHistoryInfo=
[CommandPollManage]
PollManageInfo=
[CommandGuildRoleNotAllowed]
GuildRoleNotAllowedFailure=
GuildRoleNotAllowedNoArgs=
GuildRoleNotAllowedSuccess=
[CommandCatch]
CatchInfo=
[CommandLeaderboard]
LeaderboardInfo=
LeaderboardTitle=
[CommandGuildRoleList]
GuildRoleListOutput=
GuildRoleListEmpty=
[CommandRoll]
RollError=
RollInfo=
[CommandGuildRoleAllowed]
GuildRoleAllowedSuccess=
GuildRoleAllowedDuplicate=
[CommandStats]
StatsInfo=
[CommandRole]
RoleInfo=
RoleStandardResponse=
RoleError=
RoleChanged=
RoleNeededRole=
[CommandJDoodle]
JDoodleInfo=
JDoodleError=
[CommandChangeIndicator]
ChangeIndicatorInfo=
ChangeIndicatorError=
ChangeIndicatorChanged=
[CommandPerish]
PerishInfo=
[CommandTradeBeans]
TradeBeansNoTargetError=
TradeBeansSuccess=
TradeBeansStealingBeans=
TradeBeansInfo=
TradeBeansIntParseError=
TradeBeansNotEnoughError=
[CommandPollVote]
PollVoteInfo=
PollVoteNotValidNumber=
PollVoteNoPoll=
PollVoteAlreadyVoted=
PollVoteNotValidVote=
PollVoteSuccess=
[CommandShutdown]
ShutdownSafe=
ShutdownUnsafe=
ShutdownInfo=
[CommandRaffleSpin]
RaffleSpinInfo=
RaffleSpinSuccess=
RaffleSpinFailure=
[CommandRaffleEnd]
RaffleEndSuccess=
RaffleEndInfo=
RaffleEndFailure=
[CommandCharacterSearch]
CharacterSearchNoCharacterFound=
CharacterSearchMultipleCharacterHeader=
CharacterSearchMultipleCharacter=
CharacterSearchOneCharacter=
CharacterSearchInfo=
[CommandColor]
ColorNotSearchable=
ColorInfo=
[CommandDoWork]
DoWorkInfo=
DoWorkFinished=
[CommandRPStart]
RPStartInfo=
[CommandBlurry]
BlurryInfo=
[CommandRating]
RatingInfo=
RatingWarning=
RatingChanged=
RatingInvalid=
[CommandDBStats]
DBStatsInfo=
[CommandGiveBeans]
GiveBeansNoneMentioned=
GiveBeansSuccess=
GiveBeansInvalid=
GiveBeansInfo=
[CommandPollShow]
PollShowInfo=
PollShowNoPoll=
PollShowPoll=
PollShowChoices=
[CommandHelpBuilder]
HelpBuilderInfo=
[CommandGuildRoleMain]
GuildRoleInfo=
[CommandCharacterEditURL]
CharacterEditURLInfo=
CharacterEditURLNotValid=
CharacterEditURLSuccess=
CharacterEditURLNotAuth=
[CommandRPG]
RPGInfo=
RPGInvalid=
[CommandFetch]
FetchError=
FetchEat=
FetchInfo=
FetchCatchRun=
FetchRunAway=
FetchBringBack=
FetchBringBackWrong=
FetchStare=
[CommandInfo]
InfoResponse=
InfoInfo=
[CommandGuildRoleRemove]
GuildRoleRemoveNotAllowed=
GuildRoleRemoveFailure=
GuildRoleRemoveSuccess=
[CommandWolfram]
WolframError=
WolframInfo=
WolframNoArgs=
[CommandMap]
MapInfo=
MapInvalid=
MapVersion=
MapSeed=
MapWidth=
MapHeight=
[CommandBeansShow]
BeansShowDisplay=
BeansShowMentioned=
BeansShowInfo=
[CommandRaffleStart]
RaffleStartSuccess=
RaffleStartFailure=
RaffleStartInfo=
[CommandHelp]
HelpInfo=
HelpDisplay=
[CommandCharacterEditBio]
CharacterEditBioSuccess=
CharacterEditBioNotAuth=
CharacterEditBioInfo=
CharacterEditBioNotValid=
[CommandCharacterEditName]
CharacterEditNameInfo=
CharacterEditNameNotValid=
CharacterEditNameSuccess=
CharacterEditNameNotAuth=
[CommandTweet]
TweetInfo=
TweetError=
[CommandColiru]
ColiruError=
ColiruInfo=
[CommandStark]
StarkInfo=
[CommandRemind]
RemindInfo=
[CommandYeet]
YeetInfo=
[CommandCrouton]
CroutonInfo=
[CommandCharacterCreate]
CharacterCreateDuplicate=
CharacterCreateInfo=
CharacterCreateSuccess=
CharacterCreateNullInfo=
[CommandTeey]
TeeyInfo=
[CommandBetBeans]
BetBeansInfo=
BetBeansLowBet=
BetBeansNotValid=
BetBeansLose=
BetBeansNotEnough=
BetBeansWin=
[CommandPollResults]
PollResultsResponse=
PollResultsInfo=
[CommandRPEnd]
RPEndError=
RPEndInfo=
RPEndFileOut=
[CommandBoop]
BoopPerson=
BoopInfo=
BoopStandard=
BoopMultiple=
[CommandPing]
PingResponse=
PingInfo=
[CommandChoose]
ChooseChoice=
ChooseOne=
ChooseInfo=
[CommandEightBall]
EightBallYes4=
EightBallYes3=
EightBallYes2=
EightBallYes1=
EightBallYes8=
EightBallYes7=
EightBallYes6=
EightBallYes5=
EightBallMaybe1=
EightBallMaybe2=
EightBallMaybe3=
EightBallError=
EightBallMaybe4=
EightBallMaybe5=
EightBallInfo=
EightBallNo5=
EightBallNo3=
EightBallNo4=
EightBallNo1=
EightBallNo2=
EightBallYes9=
EightBallYes10=
[CommandInvite]
InviteInfo=
[CommandRaffleJoin]
RaffleJoinFailure=
RaffleJoinInfo=
RaffleJoinSuccess=
[CommandDBFlush]
DBFlushInfo=
-40
View File
@@ -1,40 +0,0 @@
package commands;
import core.Command;
import core.LocStrings;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
import dataStructures.KittyRole;
import dataStructures.KittyUser;
import dataStructures.Response;
import dataStructures.UserInput;
public class CommandGuildRoleAdd extends Command
{
public CommandGuildRoleAdd(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String getHelpText() { return LocStrings.stub("GuildRoleAddInfo"); };
@Override
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
String role = input.args.split(" ")[0];
if(guild.roleList.contains(role))
{
if(guild.control.addRole(user.discordID, role))
{
res.send(String.format(LocStrings.stub("GuildRoleAddSuccess"), role, user.name));
}
else
{
res.send(String.format(LocStrings.stub("GuildRoleAddFailure"), role, user.name));
}
}
else
{
res.send(String.format(LocStrings.stub("GuildRoleAddNotAllowed"), role));
}
}
}
-39
View File
@@ -1,39 +0,0 @@
package commands;
import core.Command;
import core.LocStrings;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
import dataStructures.KittyRole;
import dataStructures.KittyUser;
import dataStructures.Response;
import dataStructures.UserInput;
public class CommandGuildRoleAllowed extends Command
{
public CommandGuildRoleAllowed(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String getHelpText() { return LocStrings.stub("GuildRoleAllowedInfo"); }
@Override
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
String [] roles = input.args.split(",");
String role;
for(int i = 0; i < roles.length; i++)
{
role = roles[i].trim();
if(guild.roleList.contains(role))
{
res.send(LocStrings.stub("GuildRoleAllowedDuplicate"));
}
else
{
guild.roleList.add(role);
res.send(String.format(LocStrings.stub("GuildRoleAllowedSuccess"), role));
}
}
}
}
-31
View File
@@ -1,31 +0,0 @@
package commands;
import core.Command;
import core.LocStrings;
import dataStructures.*;
import network.NetworkColiru;
public class CommandGuildRoleList extends Command
{
NetworkColiru compiler = new NetworkColiru();
public CommandGuildRoleList(KittyRole level, KittyRating rating) { super(level, rating);}
@Override
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
String roles = "";
if(guild.roleList.isEmpty())
{
res.send(String.format(LocStrings.stub("GuildRoleListEmpty")));
return;
}
for(int i = 0; i < guild.roleList.size(); i++)
{
if(i > 0)
roles += " and ";
roles += guild.roleList.get(i);
}
res.send(String.format(LocStrings.stub("GuildRoleListOutput"), roles));
}
}
@@ -1,39 +0,0 @@
package commands;
import core.Command;
import core.LocStrings;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
import dataStructures.KittyRole;
import dataStructures.KittyUser;
import dataStructures.Response;
import dataStructures.UserInput;
public class CommandGuildRoleNotAllowed extends Command
{
public CommandGuildRoleNotAllowed(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String getHelpText() { return LocStrings.stub("GuildRoleNotAllowedInfo"); }
@Override
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
String [] roles = input.args.split(",");
String role;
for(int i = 0; i < roles.length; i++)
{
role = roles[i].trim();
if(guild.roleList.contains(role))
{
guild.roleList.remove(role);
res.send(LocStrings.stub("GuildRoleNotAllowedSuccess"));
}
else
{
res.send(String.format(LocStrings.stub("GuildRoleNotAllowedFailure"), role));
}
}
}
}
-40
View File
@@ -1,40 +0,0 @@
package commands;
import core.Command;
import core.LocStrings;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
import dataStructures.KittyRole;
import dataStructures.KittyUser;
import dataStructures.Response;
import dataStructures.UserInput;
public class CommandGuildRoleRemove extends Command
{
public CommandGuildRoleRemove(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String getHelpText() { return LocStrings.stub("GuildRoleRemoveInfo"); };
@Override
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
String role = input.args.split(" ")[0];
if(guild.roleList.contains(role))
{
if(guild.control.removeRole(user.discordID, role))
{
res.send(String.format(LocStrings.stub("GuildRoleRemoveSuccess"), role, user.name));
}
else
{
res.send(String.format(LocStrings.stub("GuildRoleRemoveFailure"), role, user.name));
}
}
else
{
res.send(String.format(LocStrings.stub("GuildRoleRemoveNotAllowed"), role));
}
}
}
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.util.Random;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.awt.Color;
import java.awt.image.BufferedImage;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.*;
import dataStructures.KittyChannel;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.io.File;
import java.io.IOException;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.CharacterManager;
import core.Command;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.CharacterManager;
import core.Command;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.CharacterManager;
import core.Command;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.CharacterManager;
import core.Command;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.util.ArrayList;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.*;
import dataStructures.KittyChannel;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.awt.Color;
import java.awt.Graphics2D;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.awt.Color;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.Constants;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.*;
import dataStructures.KittyChannel;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.*;
import dataStructures.KittyChannel;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.io.File;
import java.io.FileNotFoundException;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.util.ArrayList;
import java.util.List;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.util.Random;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.awt.Color;
import java.awt.image.BufferedImage;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.*;
import dataStructures.KittyChannel;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.*;
import dataStructures.KittyChannel;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.util.ArrayList;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.*;
import dataStructures.*;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.*;
import dataStructures.*;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.io.File;
import java.io.FileNotFoundException;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.util.ArrayList;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
+40
View File
@@ -0,0 +1,40 @@
package commands.general;
import core.Command;
import core.LocStrings;
import dataStructures.*;
public class CommandRemind extends Command
{
public CommandRemind(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String getHelpText() { return LocStrings.stub("RemindInfo"); };
@Override
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
long time;
try
{
time = Long.parseLong(input.args.split(" ")[0]);
}
catch(Exception e)
{
res.send("That's not a valid time");
return;
}
res.send("Ok! I'll remind you!");
try
{
Thread.sleep(time * 1000 * 60);
res.send("<@" + user.discordID + "> don't forget: " + input.args.substring(input.args.indexOf(" ")));
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
}
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.util.Stack;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.DatabaseManager;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.awt.Color;
import java.awt.image.BufferedImage;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.io.File;
import java.io.IOException;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import core.Command;
import core.LocStrings;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.io.File;
import java.io.IOException;
@@ -1,4 +1,4 @@
package commands;
package commands.general;
import java.io.File;
import java.io.IOException;
@@ -0,0 +1,36 @@
package commands.guildrole;
import core.SubCommand;
import core.SubCommandFormattable;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
import dataStructures.KittyRole;
import dataStructures.KittyUser;
public class CommandGuildRoleAdd extends SubCommand
{
public CommandGuildRoleAdd(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
{
String role = input.split(" ")[0];
if(guild.roleList.contains(role))
{
if(guild.control.addRole(user.discordID, role))
{
return new SubCommandFormattable("ADDED RIN YOU NEED TO FIX THIS");
}
else
{
return new SubCommandFormattable("FAILED RIN YOU NEED TO FIX THIS TOO");
}
}
else
{
return new SubCommandFormattable("NOT ALLOWED FIX THIS ONE TOO SNEP FACE");
}
}
}
@@ -0,0 +1,37 @@
package commands.guildrole;
import core.LocStrings;
import core.SubCommand;
import core.SubCommandFormattable;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
import dataStructures.KittyRole;
import dataStructures.KittyUser;
public class CommandGuildRoleAllowed extends SubCommand
{
public CommandGuildRoleAllowed(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
{
String [] roles = input.split(",");
String role;
String formatted = "";
for(int i = 0; i < roles.length; i++)
{
role = roles[i].trim();
if(guild.roleList.contains(role))
{
formatted += String.format(LocStrings.stub("GuildRoleAllowedDuplicate"), role);
}
else
{
guild.roleList.add(role);
formatted += (String.format(LocStrings.stub("GuildRoleAllowedSuccess"), role));
}
}
return new SubCommandFormattable(formatted);
}
}
@@ -0,0 +1,33 @@
package commands.guildrole;
import core.LocStrings;
import core.SubCommand;
import core.SubCommandFormattable;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
import dataStructures.KittyRole;
import dataStructures.KittyUser;
public class CommandGuildRoleList extends SubCommand
{
public CommandGuildRoleList(KittyRole level, KittyRating rating) { super(level, rating);}
@Override
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
{
String roles = "";
if(guild.roleList.isEmpty())
{
return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleListEmpty")));
}
for(int i = 0; i < guild.roleList.size(); i++)
{
if(i > 0)
roles += "\n";
roles += guild.roleList.get(i);
}
return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleListOutput"), roles));
}
}
@@ -0,0 +1,37 @@
package commands.guildrole;
import core.Command;
import core.LocStrings;
import core.SubCommandFramework;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
import dataStructures.KittyRole;
import dataStructures.KittyUser;
import dataStructures.Response;
import dataStructures.UserInput;
public class CommandGuildRoleMain extends Command
{
SubCommandFramework framework = new SubCommandFramework();
public CommandGuildRoleMain(KittyRole level, KittyRating rating)
{
super(level, rating);
framework.addCommand("add", new CommandGuildRoleAdd (KittyRole.General, KittyRating.Safe));
framework.addCommand("remove", new CommandGuildRoleRemove(KittyRole.General, KittyRating.Safe));
framework.addCommand("allowed", new CommandGuildRoleAllowed(KittyRole.Admin, KittyRating.Safe));
framework.addCommand("unallowed", new CommandGuildRoleNotAllowed(KittyRole.Admin, KittyRating.Safe));
}
@Override
public String getHelpText() { return LocStrings.stub("GuildRoleInfo"); }
@Override
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
framework.run(guild, channel, user, input.args).Call(res);
}
}
@@ -0,0 +1,35 @@
package commands.guildrole;
import core.LocStrings;
import core.SubCommand;
import core.SubCommandFormattable;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
import dataStructures.KittyRole;
import dataStructures.KittyUser;
public class CommandGuildRoleNotAllowed extends SubCommand
{
public CommandGuildRoleNotAllowed(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
{
input = input.toLowerCase();
String [] roles = input.split(",");
for(String role:roles)
{
if(guild.roleList.contains(role.trim()))
{
guild.roleList.remove(role);
return new SubCommandFormattable(LocStrings.stub("GuildRoleNotAllowedSuccess"));
}
else
{
return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleNotAllowedFailure"), role));
}
}
return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleNotAllowedNoArgs")));
}
}
@@ -0,0 +1,35 @@
package commands.guildrole;
import core.LocStrings;
import core.SubCommand;
import core.SubCommandFormattable;
import dataStructures.*;
public class CommandGuildRoleRemove extends SubCommand
{
public CommandGuildRoleRemove(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
{
String role = input.split(" ")[0];
String formatted = "";
if(guild.roleList.contains(role))
{
if(guild.control.removeRole(user.discordID, role))
{
formatted += (String.format(LocStrings.stub("GuildRoleRemoveSuccess"), role, user.name));
}
else
{
formatted += (String.format(LocStrings.stub("GuildRoleRemoveFailure"), role, user.name));
}
}
else
{
formatted += (String.format(LocStrings.stub("GuildRoleRemoveNotAllowed"), role));
}
return new SubCommandFormattable(formatted);
}
}
+56
View File
@@ -7,6 +7,8 @@ import java.util.concurrent.Semaphore;
import javax.security.auth.login.LoginException;
import commands.general.*;
import commands.guildrole.CommandGuildRoleMain;
import core.lua.PluginManager;
import dataStructures.*;
import main.Main;
@@ -377,6 +379,60 @@ public class ObjectBuilderFactory
return commandManager;
// Admin
manager.register(LocCommands.stub("rating"), new CommandRating(KittyRole.Admin, KittyRating.Safe));
manager.register(LocCommands.stub("indicator"), new CommandChangeIndicator(KittyRole.Admin, KittyRating.Safe));
// Mod
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("rpg"), new CommandRPG(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("raffleend"), new CommandRaffleEnd(KittyRole.Mod, KittyRating.Safe));
// General
manager.register(LocCommands.stub("fetch"), new CommandFetch(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("yeet"), new CommandYeet(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("roll"), new CommandRoll(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("info, about"), new CommandInfo(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("showpoll"), new CommandPollShow(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("java, jdoodle"), new CommandJDoodle(KittyRole.General, KittyRating.Safe));
manager.register(LocCommands.stub("beans"), new CommandBeansShow(KittyRole.General, KittyRating.Safe));
manager.register(LocCommands.stub("kittyrole"), new CommandRole(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("rpstart"), new CommandRPStart(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("blur"), new CommandBlurry(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("bethistory"), new CommandBetHistory(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("rafflejoin"), new CommandRaffleJoin(KittyRole.General, KittyRating.Safe));
manager.register(LocCommands.stub("charactercreate"), new CommandCharacterCreate(KittyRole.General, KittyRating.Safe));
manager.register(LocCommands.stub("searchcharacter"), new CommandCharacterSearch(KittyRole.General, KittyRating.Safe));
manager.register(LocCommands.stub("charactereditbio"), new CommandCharacterEditBio(KittyRole.General, KittyRating.Safe));
manager.register(LocCommands.stub("charactereditname"), new CommandCharacterEditName(KittyRole.General, KittyRating.Safe));
manager.register(LocCommands.stub("charactereditURL"), new CommandCharacterEditURL(KittyRole.General, KittyRating.Safe));
manager.register(LocCommands.stub("leaderboard"), new CommandLeaderboard(KittyRole.General, KittyRating.Safe));
manager.register(LocCommands.stub("color, colour"), new CommandColor(KittyRole.General, KittyRating.Safe));
manager.register(LocCommands.stub("remind"), new CommandRemind(KittyRole.General, KittyRating.Safe));
manager.register(LocCommands.stub("role"), new CommandGuildRoleMain(KittyRole.General, KittyRating.Safe));
return manager;
}
// Default database manager construction. It can be constructed
+2 -1
View File
@@ -22,11 +22,12 @@ public class SubCommandFramework
if(commands.put(name, command) != null)
GlobalLog.error("Multiple registration of a name with name '" + name + "'!");
GlobalLog.log("Registered " + name);
GlobalLog.log("Registered SubCommand " + name);
}
public SubCommandFormattable run(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
{
System.out.print(input);
SubCommandFormattable res = commands.get(input.split(" ")[0].toLowerCase()).OnRun(guild, channel, user, input.substring(input.indexOf(" ")));
return res;
}