+Moved guildrole commands to subcommand routine

This commit is contained in:
Alex
2019-06-30 03:20:46 -04:00
parent df7973b3d7
commit 392ba0e19c
73 changed files with 353 additions and 447 deletions
+2
View File
@@ -35,6 +35,7 @@ indicator=1
info, about=1 info, about=1
invite=1 invite=1
java, jdoodle=1 java, jdoodle=1
kittyrole=1
leaderboard=1 leaderboard=1
map=1 map=1
perish, thenperish=1 perish, thenperish=1
@@ -45,6 +46,7 @@ rafflejoin=1
rafflespin=1 rafflespin=1
rafflestart=1 rafflestart=1
rating=1 rating=1
remind=1
results=1 results=1
role=1 role=1
roll=1 roll=1
+2
View File
@@ -34,10 +34,12 @@ raffleend=
ping= ping=
charactereditbio= charactereditbio=
roll= roll=
kittyrole=
blur= blur=
choose= choose=
rpstart= rpstart=
guildrolenotallowed=guildrolenotallowed, rolelistremove guildrolenotallowed=guildrolenotallowed, rolelistremove
remind=
derp= derp=
perish, thenperish= perish, thenperish=
teey= teey=
+37 -198
View File
@@ -1,278 +1,185 @@
[CommandBenchmark] [CommandBenchmark]
BenchmarkInvalid=The benchmark operation you were trying to perform was invalid! BenchmarkInfo=
BenchmarkInfo=Allows you to lookup PC component benchmarks from UserBenchmark! You can use `bench find <name-snippet>
BenchmarkInvalid= BenchmarkInvalid=
[CommandBetHistory]
BetHistoryOutput=
BetHistoryInfo=
[CommandPollManage] [CommandPollManage]
PollManageInfo= PollManageInfo=
PollManageInfo='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
[CommandBetHistory]
BetHistoryOutput=I have %s treats from betting!
BetHistoryOutput=
BetHistoryInfo=Gives how many beans I've ~~stolen~~ won from your bets!
BetHistoryInfo=
[CommandGuildRoleNotAllowed] [CommandGuildRoleNotAllowed]
GuildRoleNotAllowedFailure= GuildRoleNotAllowedFailure=
GuildRoleNotAllowedNoArgs=
GuildRoleNotAllowedSuccess= GuildRoleNotAllowedSuccess=
GuildRoleNotAllowedInfo=Removes a role from the list that users are allowed to add to themselves.
GuildRoleNotAllowedInfo=
GuildRoleNotAllowedFailure=Unable to remove %s from the list!
GuildRoleNotAllowedSuccess=Removed %s from the allowed roles!
[CommandCatch] [CommandCatch]
CatchInfo= CatchInfo=
CatchInfo=Play catch with yourself or with a friend with @!
[CommandLeaderboard] [CommandLeaderboard]
LeaderboardTitle=Server Leaderboard
LeaderboardInfo=Shows you the 10 users with the most beans on the server
LeaderboardInfo= LeaderboardInfo=
LeaderboardTitle= LeaderboardTitle=
[CommandGuildRoleList] [CommandGuildRoleList]
GuildRoleListOutput= GuildRoleListOutput=
GuildRoleListEmpty= GuildRoleListEmpty=
GuildRoleListOutput=You can add these roles! %s
[CommandRoll] [CommandRoll]
RollInfo=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
RollError= RollError=
RollError=Didn't work ;3;
RollInfo= RollInfo=
[CommandGuildRoleAllowed] [CommandGuildRoleAllowed]
GuildRoleAllowedInfo=
GuildRoleAllowedSuccess= GuildRoleAllowedSuccess=
GuildRoleAllowedDuplicate= GuildRoleAllowedDuplicate=
[CommandStats] [CommandStats]
StatsInfo= StatsInfo=
StatsInfo=Displays the actively running KittyBot application information
[CommandRole] [CommandRole]
RoleChanged=Changed %s to role `%s`!
RoleInfo= RoleInfo=
RoleStandardResponse= RoleStandardResponse=
RoleError=You aren't allowed to do that! You must have the KittyRole '%' or higher!
RoleStandardResponse=Your role is %s
RoleError= RoleError=
RoleInfo=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.
RoleChanged= RoleChanged=
RoleNeededRole=Please enter `general`, `mod`, or `admin`!
RoleNeededRole= RoleNeededRole=
[CommandJDoodle] [CommandJDoodle]
JDoodleInfo=Will compile any java code you put in! Supports Java 1.8
JDoodleError=Please provide some java code to get it compiled!
JDoodleInfo= JDoodleInfo=
JDoodleError= JDoodleError=
[CommandChangeIndicator] [CommandChangeIndicator]
ChangeIndicatorError=Please specify a letter or symbol to use!
ChangeIndicatorInfo=Changes the command indicator to any single character. By default, it's '!'. If more than one character is provided, the first one is used!
ChangeIndicatorChanged=Indicator changed to `%s`
ChangeIndicatorInfo= ChangeIndicatorInfo=
ChangeIndicatorError= ChangeIndicatorError=
ChangeIndicatorChanged= ChangeIndicatorChanged=
[CommandPerish] [CommandPerish]
PerishInfo=Adds a red, 'a n g e r y' overlay to your icon or the icon of a friend you mentioned
PerishInfo= PerishInfo=
[CommandTradeBeans] [CommandTradeBeans]
TradeBeansNoTargetError= TradeBeansNoTargetError=
TradeBeansSuccess= TradeBeansSuccess=
TradeBeansStealingBeans=Hey %s! Stealing is wrong! Let's see how you like it! *steals 10 beans*
TradeBeansSuccess=%s gave %s %s beans!
TradeBeansNotEnoughError=You can't give more beans than you have!
TradeBeansIntParseError=That's not a real number! D:
TradeBeansNoTargetError=Don't forget to tag who you want to give the beans to!
TradeBeansStealingBeans= TradeBeansStealingBeans=
TradeBeansInfo=Give your friends some of your beans! Just don't forget to @ them!
TradeBeansInfo= TradeBeansInfo=
TradeBeansIntParseError= TradeBeansIntParseError=
TradeBeansNotEnoughError= TradeBeansNotEnoughError=
[CommandPollVote] [CommandPollVote]
PollVoteInfo=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!
PollVoteInfo= PollVoteInfo=
PollVoteNotValidNumber= PollVoteNotValidNumber=
PollVoteAlreadyVoted=You already voted
PollVoteNoPoll=There is no poll running!
PollVoteNoPoll= PollVoteNoPoll=
PollVoteAlreadyVoted= PollVoteAlreadyVoted=
PollVoteNotValidVote= PollVoteNotValidVote=
PollVoteNotValidNumber=That's not a vaild number!
PollVoteNotValidVote=%s That's not a vaild vote!
PollVoteSuccess=You successfully voted for
PollVoteSuccess= PollVoteSuccess=
[CommandShutdown] [CommandShutdown]
ShutdownSafe= ShutdownSafe=
ShutdownUnsafe= ShutdownUnsafe=
ShutdownInfo=Stops kitty. `-s` or `safe` as an argument attempts to sync off the database before shutdown.
ShutdownInfo= ShutdownInfo=
[CommandRaffleSpin] [CommandRaffleSpin]
RaffleSpinInfo= RaffleSpinInfo=
RaffleSpinSuccess= RaffleSpinSuccess=
RaffleSpinFailure= RaffleSpinFailure=
RaffleSpinSuccess=The winner issssssss %s!
RaffleSpinFailure=I can't choose a winner D:
RaffleSpinInfo=
[CommandRaffleEnd] [CommandRaffleEnd]
RaffleEndSuccess= RaffleEndSuccess=
RaffleEndSuccess=
RaffleEndInfo= RaffleEndInfo=
RaffleEndInfo=
RaffleEndFailure=I don't think there's one going!
RaffleEndFailure= RaffleEndFailure=
[CommandCharacterSearch] [CommandCharacterSearch]
CharacterSearchNoCharacterFound= CharacterSearchNoCharacterFound=
CharacterSearchMultipleCharacterHeader= CharacterSearchMultipleCharacterHeader=
CharacterSearchMultipleCharacter= CharacterSearchMultipleCharacter=
CharacterSearchMultipleCharacter=%s is owned by %s. Unique ID is `%s`
CharacterSearchMultipleCharacterHeader=I found a couple characters with that name, use `charactersearch UniqueID` with their Unique ID to find them!
CharacterSearchOneCharacter=I found one character with that name! \n Owner: %s | Name: %s | Bio: %s | Ref: <%s> | Unique ID: `%s`
CharacterSearchOneCharacter= CharacterSearchOneCharacter=
CharacterSearchInfo=Find a character with their name or Unique ID! `charactersearch name` or `charactersearch UniqueID` CharacterSearchInfo=
CharacterSearchNoCharacterFound=Couldn't find a character with that name or ID!
[CommandColor] [CommandColor]
ColorNotSearchable=Your color couldn't be parsed! Make sure it's in hex format. Try this! `!color 3F5D54` ColorNotSearchable=
ColorInfo=Looks up the provided hex color and outputs it as hex, rgb, hsl, hsv, xyz, and cmyk. Also attempts to name the color, and provies a sample of it! Usage example: `!color #365345` (the # can be omitted) ColorInfo=
[CommandDoWork] [CommandDoWork]
DoWorkInfo=Occupies a core for a few seconds
DoWorkFinished=I finished with my work! :D
DoWorkInfo= DoWorkInfo=
DoWorkFinished= DoWorkFinished=
[CommandRPStart] [CommandRPStart]
RPStartInfo=Starts an rp, add people to it by mentioning them!
RPStartInfo= RPStartInfo=
[CommandBlurry] [CommandBlurry]
BlurryInfo=Blurs your icon or the icon of a friend you mentioned
BlurryInfo= BlurryInfo=
[CommandRating] [CommandRating]
RatingInvalid=Invalid content rating
RatingInfo= RatingInfo=
RatingInfo='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.
RatingWarning= RatingWarning=
RatingWarning=Warning: NSFW may slip through, images are only based on tags on their respective sites!
RatingChanged= RatingChanged=
RatingInvalid= RatingInvalid=
RatingChanged=Kittybot content set to %s
[CommandDBStats] [CommandDBStats]
DBStatsInfo=Shows current statistics for the database DBStatsInfo=
[CommandGiveBeans] [CommandGiveBeans]
GiveBeansNoneMentioned= GiveBeansNoneMentioned=
GiveBeansInvalid=That's not a valid number!
GiveBeansSuccess= GiveBeansSuccess=
GiveBeansSuccess=Gave %s %s beans!
GiveBeansInvalid= GiveBeansInvalid=
GiveBeansInfo=Gives beans to the mentioned users!
GiveBeansNoneMentioned=You didn't mention anyone!
GiveBeansInfo= GiveBeansInfo=
[CommandPollShow] [CommandPollShow]
PollShowInfo= PollShowInfo=
PollShowNoPoll= PollShowNoPoll=
PollShowNoPoll=There is no poll running!
PollShowInfo=Will show the current poll running
PollShowPoll= PollShowPoll=
PollShowChoices=And the choices are:\n
PollShowChoices= PollShowChoices=
PollShowPoll=The current poll is `%s`\n
[CommandHelpBuilder] [CommandHelpBuilder]
HelpBuilderInfo=Emit help for all commands as formatted HTML
HelpBuilderInfo= HelpBuilderInfo=
[CommandGuildRoleMain]
GuildRoleInfo=
[CommandCharacterEditURL] [CommandCharacterEditURL]
CharacterEditURLInfo=Change the image URL for your character's reference! CharacterEditURLInfo=
CharacterEditURLNotValid=That's not a valid url! CharacterEditURLNotValid=
CharacterEditURLSuccess=Successfully changed your reference! CharacterEditURLSuccess=
CharacterEditURLNotAuth=You're not authorized to change that character! CharacterEditURLNotAuth=
[CommandRPG] [CommandRPG]
RPGInfo=Admin+ command only right now - experimental text RPG! Format is !rpg <rpg command="">
RPGInfo= RPGInfo=
RPGInvalid= RPGInvalid=
RPGInvalid=Invalid RPG Command!
[CommandFetch] [CommandFetch]
FetchEat=Mine now! *munches on %s*
FetchBringBack=Got it! %s
FetchError=That's not a custom emote!
FetchEat=
FetchInfo=Throw a custom emote and I'll try to bring it back.... maybe
FetchInfo=
FetchRunAway=
FetchStare=*Stares at %s*
FetchBringBack=
FetchRunAway=*Runs away and doesn't return for a long time*
FetchCatchRun=*Catches and runs away with %s*
FetchError= FetchError=
FetchEat=
FetchInfo=
FetchCatchRun= FetchCatchRun=
FetchRunAway=
FetchBringBack=
FetchBringBackWrong= FetchBringBackWrong=
FetchStare= FetchStare=
FetchBringBackWrong=Got it! %s
[CommandInfo] [CommandInfo]
InfoResponse= InfoResponse=
InfoResponse=I'm made by `Rin#8904` and `Reverie Wisp#3703`! You can find more info about me along with a Patreon link to support us and GitHub link for filing bugs https://kittybot.net
InfoInfo= InfoInfo=
InfoInfo=Provides author info and a link to Kitty's website
[CommandGuildRoleRemove] [CommandGuildRoleRemove]
GuildRoleRemoveNotAllowed= GuildRoleRemoveNotAllowed=
GuildRoleRemoveFailure= GuildRoleRemoveFailure=
GuildRoleRemoveSuccess= GuildRoleRemoveSuccess=
GuildRoleRemoveNotAllowed=You're not allowed to add %s!
GuildRoleRemoveInfo=
GuildRoleRemoveFailure=I wasn't able to remove %s from %s!
GuildRoleRemoveInfo=Removes a role from you! Just remember to spell it right!
GuildRoleRemoveSuccess=Removed %s from %s!
[CommandWolfram] [CommandWolfram]
WolframInfo=Will query wolframalpha with your question and give a full image output of the answer
WolframNoArgs=You need to provide some arguments!
WolframError= WolframError=
WolframError=Something went wrong!
WolframInfo= WolframInfo=
WolframNoArgs= WolframNoArgs=
[CommandMap] [CommandMap]
MapVersion=Using mapgen v0.1 MapInfo=
MapSeed=Seed
MapInfo=Generates a map! You can pass additional information if you want with the flags `-s<seed>
MapInvalid= MapInvalid=
MapVersion= MapVersion=
`. 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\n**Defaults**\nDefault Seed: Random,\nDefault Width: 35(max %s),\nDefault Height: 25(max %s)\n\n**Key**\nLand: ~\nMountain: ▲\nBeach: =\nForest: ¥\nLava: #
MapInvalid=Invalid arguments provided!
MapWidth=Width
MapInfo=
MapSeed= MapSeed=
MapWidth= MapWidth=
MapHeight=Height
MapHeight= MapHeight=
[CommandBeansShow] [CommandBeansShow]
BeansShowDisplay=You have %s beans!
BeansShowDisplay= BeansShowDisplay=
BeansShowMentioned= BeansShowMentioned=
BeansShowInfo= BeansShowInfo=
BeansShowInfo=Displays how many beans you have
BeansShowMentioned=I took a look and %sbeans!
[CommandRaffleStart] [CommandRaffleStart]
RaffleStartSuccess= RaffleStartSuccess=
@@ -280,63 +187,39 @@ RaffleStartFailure=
RaffleStartInfo= RaffleStartInfo=
[CommandHelp] [CommandHelp]
HelpInfo=Lets you look up specific commands, or get a link to a list of all commands.
HelpDisplay=You can get help with a specific command by typing `!help command`! General Commands: `boop, roll, choose, help, info, vote, results, showpoll, wolfram, cplus, java, beans, role, bet, yeet`
HelpInfo= HelpInfo=
HelpDisplay= HelpDisplay=
[CommandCharacterEditBio] [CommandCharacterEditBio]
CharacterEditBioSuccess=Successfully changed your bio! CharacterEditBioSuccess=
CharacterEditBioNotAuth=You're not authorized to change that character! CharacterEditBioNotAuth=
CharacterEditBioInfo=Change the short bio for your character! CharacterEditBioInfo=
CharacterEditBioNotValid= CharacterEditBioNotValid=
[CommandCharacterEditName]
CharacterEditNameInfo=
CharacterEditNameNotValid=
CharacterEditNameSuccess=
CharacterEditNameNotAuth=
[CommandTweet] [CommandTweet]
TweetInfo=Kitty will tweet to her personal twitter account
TweetError=Tweet command failed!
TweetInfo= TweetInfo=
TweetError= TweetError=
[CommandGuildRoleAdd]
AddGuildRoleFailure=Failed to add %s to %s
GuildRoleAddNotAllowed=You are not allowed to add %s!
GuildRoleAddSuccess=
GuildRoleAddFailure=
GuildRoleAddSuccess=Added %s to %s
GuildRoleAddInfo=Add a role to yourself!
GuildRoleAddNotAllowed=
GuildRoleAddInfo=
[CommandCharacterEditName]
CharacterEditNameInfo=Change your character's name!
CharacterEditNameNotValid=That's not a vaild name!
CharacterEditNameSuccess=Successfully changed your name!
CharacterEditNameNotAuth=You're not authorized to change that character!
[CommandColiru] [CommandColiru]
ColiruError= ColiruError=
ColiruError=Please provide some c++ code to attempt to compile!
ColiruInfo= ColiruInfo=
ColiruInfo=Will try to compile any c++ code you put in! Supports up to C++14 standard, uses g++.
[CommandStark] [CommandStark]
StarkInfo= StarkInfo=
StarkInfo=Snaps your icon or the icon of a friend you mentioned
[CommandRemind]
RemindInfo=
[CommandYeet] [CommandYeet]
YeetInfo= YeetInfo=
YeetInfo=Yeet yourself or yeet a friend with @!
[CommandAllowedGuildRole]
GuildRoleAllowedDuplicate=Can't add the same role twice!
GuildRoleAllowedInfo=Adds role to the list of roles users are allowed to add to themselves.
GuildRoleAllowedSuccess=Added %s to the allowed roles!
[CommandDefaultDance]
DefaultDanceInfo=y'all know forknife, get ready to dance, or make a friend dance with @!
[CommandCrouton] [CommandCrouton]
CroutonInfo=Crouton
CroutonInfo= CroutonInfo=
[CommandCharacterCreate] [CommandCharacterCreate]
@@ -346,74 +229,42 @@ CharacterCreateSuccess=
CharacterCreateNullInfo= CharacterCreateNullInfo=
[CommandTeey] [CommandTeey]
TeeyInfo=Teey yourself back into existance, or teey a friend with @!
TeeyInfo= TeeyInfo=
[CommandBetBeans] [CommandBetBeans]
BetBeansLose=Sorry, you didn't win, try again!
BetBeansWin=You won %s beans!
BetBeansLowBet=Please bet with at least 20 beans!
BetBeansInfo= BetBeansInfo=
BetBeansLowBet= BetBeansLowBet=
BetBeansNotValid= BetBeansNotValid=
BetBeansLose= BetBeansLose=
BetBeansNotEnough= BetBeansNotEnough=
BetBeansWin= BetBeansWin=
BetBeansInfo=Allows you to bet your beans, set your amount after the command! Warning! House always wins!\nSets of 3 will get 2x, 4 will get 10x, and 5 will get 1000x
BetBeansNotEnough=You don't have enough beans!
BetBeansNotValid=That's not a valid bet!
[CommandPollResults] [CommandPollResults]
PollResultsResponse= PollResultsResponse=
PollResultsResponse=%s people voted for %s `%s` with `%s%` !\n
PollResultsInfo=Will show current results of a poll and percentages of votes per choice
PollResultsInfo= PollResultsInfo=
[CommandRPEnd] [CommandRPEnd]
RPEndInfo=Ends RP in channel and gives you a .txt file!
RPEndError= RPEndError=
RPEndError=You can't end this RP!
RPEndFileOut=Here's your file!
RPEndInfo= RPEndInfo=
RPEndFileOut= RPEndFileOut=
[CommandBoop] [CommandBoop]
BoopMultiple=%s booped several others - %s!
BoopPerson= BoopPerson=
BoopInfo= BoopInfo=
BoopInfo=Kitty will react with a counter
BoopStandard=Woah! %s booped me! That's %s total!
BoopPerson=%s booped %s!
BoopStandard= BoopStandard=
BoopMultiple= BoopMultiple=
[CommandPing] [CommandPing]
PingInfo=Will respond with Pong!
PingResponse=Pong!
PingResponse= PingResponse=
PingInfo= PingInfo=
[CommandChoose] [CommandChoose]
ChooseChoice= ChooseChoice=
ChooseOne=I can't choose from *one* thing!
ChooseOne= ChooseOne=
ChooseChoice=I chooooooose %s!
ChooseInfo=With an input of x,y,z where x y and z are all choices, kitty will choose one
ChooseInfo= ChooseInfo=
[CommandEightBall] [CommandEightBall]
EightBallYes9=Yes.
EightBallInfo=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.
EightBallError=
EightBallMaybe4=Cannot predict now.
EightBallMaybe5=Concentrate and ask again.
EightBallMaybe2=Ask again later.
EightBallMaybe3=Better not tell you now.
EightBallYes10=Signs point to yes.
EightBallYes9=
EightBallMaybe1=Reply hazy, try again.
EightBallYes4= EightBallYes4=
EightBallError=Hmm? You'll need to ask a question!
EightBallYes3= EightBallYes3=
EightBallYes2= EightBallYes2=
EightBallYes1= EightBallYes1=
@@ -424,32 +275,20 @@ EightBallYes5=
EightBallMaybe1= EightBallMaybe1=
EightBallMaybe2= EightBallMaybe2=
EightBallMaybe3= EightBallMaybe3=
EightBallError=
EightBallMaybe4= EightBallMaybe4=
EightBallMaybe5= EightBallMaybe5=
EightBallInfo= EightBallInfo=
EightBallNo5= EightBallNo5=
EightBallNo2=My reply is no.
EightBallNo3= EightBallNo3=
EightBallNo1=Don't count on it.
EightBallNo4= EightBallNo4=
EightBallNo4=Outlook not so good.
EightBallNo1= EightBallNo1=
EightBallNo3=My sources say no.
EightBallNo2= EightBallNo2=
EightBallNo5=Very doubtful. EightBallYes9=
EightBallYes2=It is decidedly so.
EightBallYes1=It is certain.
EightBallYes4=Yes - definitely.
EightBallYes3=Without a doubt.
EightBallYes6=As I see it, yes.
EightBallYes5=You may rely on it.
EightBallYes8=Outlook good.
EightBallYes7=Most likely.
EightBallYes10= EightBallYes10=
[CommandInvite] [CommandInvite]
InviteInfo= InviteInfo=
InviteInfo=Provides a direct invite link for KittyBot
[CommandRaffleJoin] [CommandRaffleJoin]
RaffleJoinFailure= RaffleJoinFailure=
@@ -457,6 +296,6 @@ RaffleJoinInfo=
RaffleJoinSuccess= RaffleJoinSuccess=
[CommandDBFlush] [CommandDBFlush]
DBFlushInfo=Takes all objects queued for the database and writes them to the database, then says how many were written. 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.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.util.Random; import java.util.Random;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.awt.Color; import java.awt.Color;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.*; import core.*;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.CharacterManager; import core.CharacterManager;
import core.Command; import core.Command;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.CharacterManager; import core.CharacterManager;
import core.Command; import core.Command;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.CharacterManager; import core.CharacterManager;
import core.Command; import core.Command;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.CharacterManager; import core.CharacterManager;
import core.Command; import core.Command;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.util.ArrayList; import java.util.ArrayList;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.*; import core.*;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.awt.Color; import java.awt.Color;
import java.awt.Graphics2D; import java.awt.Graphics2D;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.awt.Color; import java.awt.Color;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.Config; import core.Config;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.*; import core.*;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.*; import core.*;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.util.Random; import java.util.Random;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.awt.Color; import java.awt.Color;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.*; import core.*;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.*; import core.*;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.util.ArrayList; import java.util.ArrayList;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.*; import core.*;
import dataStructures.*; import dataStructures.*;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.*; import core.*;
import dataStructures.*; import dataStructures.*;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.util.ArrayList; import java.util.ArrayList;
+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.Command;
import core.DatabaseManager; import core.DatabaseManager;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.awt.Color; import java.awt.Color;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.io.File; import java.io.File;
import java.io.IOException; 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);
}
}
+5 -7
View File
@@ -7,7 +7,8 @@ import java.util.concurrent.Semaphore;
import javax.security.auth.login.LoginException; import javax.security.auth.login.LoginException;
import commands.*; import commands.general.*;
import commands.guildrole.CommandGuildRoleMain;
import core.lua.PluginManager; import core.lua.PluginManager;
import dataStructures.*; import dataStructures.*;
import main.Main; import main.Main;
@@ -386,8 +387,6 @@ public class ObjectBuilderFactory
// 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("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));
@@ -399,8 +398,6 @@ public class ObjectBuilderFactory
// 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("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));
@@ -417,7 +414,7 @@ public class ObjectBuilderFactory
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("kittyrole"), 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));
@@ -426,7 +423,6 @@ public class ObjectBuilderFactory
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("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));
@@ -438,6 +434,8 @@ public class ObjectBuilderFactory
manager.register(LocCommands.stub("charactereditURL"), new CommandCharacterEditURL(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("leaderboard"), new CommandLeaderboard(KittyRole.General, KittyRating.Safe));
manager.register(LocCommands.stub("color, colour"), new CommandColor(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; return manager;
} }
+2 -2
View File
@@ -18,7 +18,7 @@ public abstract class SubCommand
private void Reject(KittyUser user, String reason) private void Reject(KittyUser user, String reason)
{ {
GlobalLog.Warn(LogFilter.Command, this.getClass().getSimpleName() + " from " + user.name + " rejected due to command's " + reason); GlobalLog.warn(LogFilter.Command, this.getClass().getSimpleName() + " from " + user.name + " rejected due to command's " + reason);
} }
private boolean CanCall(KittyGuild guild, KittyChannel channel, KittyUser user) private boolean CanCall(KittyGuild guild, KittyChannel channel, KittyUser user)
@@ -31,7 +31,7 @@ public abstract class SubCommand
//TODO: ADD CHANNEL CHECK HERE //TODO: ADD CHANNEL CHECK HERE
if(user.GetRole().getValue() >= roleLevel.getValue()) if(user.getRole().getValue() >= roleLevel.getValue())
{ {
return true; return true;
} }
+2 -2
View File
@@ -33,8 +33,8 @@ public class SubCommandFormattable
public void Call(Response res) public void Call(Response res)
{ {
if(resEmbed == null) if(resEmbed == null)
res.Call(resString); res.send(resString);
else else
res.CallEmbed(resEmbed); res.send(resEmbed);
} }
} }
+3 -2
View File
@@ -20,13 +20,14 @@ public class SubCommandFramework
{ {
name = name.toLowerCase(); name = name.toLowerCase();
if(commands.put(name, command) != null) if(commands.put(name, command) != null)
GlobalLog.Error("Multiple registration of a name with name '" + name + "'!"); 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) 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(" "))); SubCommandFormattable res = commands.get(input.split(" ")[0].toLowerCase()).OnRun(guild, channel, user, input.substring(input.indexOf(" ")));
return res; return res;
} }