Merge branch 'feature/collapsed_configs' into develop

This commit is contained in:
Matthew Cech
2019-06-30 00:43:28 -07:00
106 changed files with 2298 additions and 1351 deletions
+5
View File
@@ -15,5 +15,10 @@
<classpathentry kind="lib" path="lib/twitter4j-core-4.0.7.jar"/> <classpathentry kind="lib" path="lib/twitter4j-core-4.0.7.jar"/>
<classpathentry kind="lib" path="lib/luaj-jse-3.0.1.jar"/> <classpathentry kind="lib" path="lib/luaj-jse-3.0.1.jar"/>
<classpathentry kind="lib" path="lib/fuzzywuzzy-1.2.0.jar"/> <classpathentry kind="lib" path="lib/fuzzywuzzy-1.2.0.jar"/>
<classpathentry kind="lib" path="lib/opencsv-4.6.jar"/>
<classpathentry kind="lib" path="lib/commons-beanutils-1.9.3.jar"/>
<classpathentry kind="lib" path="lib/commons-collections4-4.3.jar"/>
<classpathentry kind="lib" path="lib/commons-lang3-3.9.jar"/>
<classpathentry kind="lib" path="lib/commons-text-1.6.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>
+3 -3
View File
@@ -31,14 +31,14 @@ if(bar)
``` ```
#### Naming #### Naming
Class names and function names are `PascalCase`. Variable names are `camelCase`. Class, Interface, and Enum names are `PascalCase`. Variable and function names are `camelCase`. Interfaces in particular must begin with a capital `I`.
```java ```java
public class MyClass public class MyClass implements IClass
{ {
private Foo myVariable; private Foo myVariable;
public function MyFuction() public function myFuction()
{ {
// ... // ...
} }
-59
View File
@@ -1,59 +0,0 @@
[CommandEnabler]
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
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
leaderboard=1
map=1
perish, thenperish=1
ping=1
poll=1
raffleend=1
rafflejoin=1
rafflespin=1
rafflestart=1
rating=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
+319
View File
@@ -0,0 +1,319 @@
"Type","Key","Value"
"Localized Commands","beans",""
"Localized Commands","benchmark, bench",""
"Localized Commands","bet",""
"Localized Commands","bethistory",""
"Localized Commands","blur",""
"Localized Commands","boop",""
"Localized Commands","buildHelp",""
"Localized Commands","c++, g++, cplus, cpp",""
"Localized Commands","catch",""
"Localized Commands","charactercreate",""
"Localized Commands","charactereditbio",""
"Localized Commands","charactereditname",""
"Localized Commands","charactereditURL",""
"Localized Commands","choose",""
"Localized Commands","color, colour",""
"Localized Commands","crouton",""
"Localized Commands","dbflush",""
"Localized Commands","dbstats",""
"Localized Commands","defaultdance",""
"Localized Commands","derp",""
"Localized Commands","e621",""
"Localized Commands","eightball, 8ball",""
"Localized Commands","fetch",""
"Localized Commands","givebeans",""
"Localized Commands","guildroleadd",""
"Localized Commands","guildroleallowed",""
"Localized Commands","guildrolelist",""
"Localized Commands","guildrolenotallowed","guildrolenotallowed, rolelistremove"
"Localized Commands","guildroleremove",""
"Localized Commands","help",""
"Localized Commands","indicator",""
"Localized Commands","info, about",""
"Localized Commands","invite",""
"Localized Commands","java, jdoodle",""
"Localized Commands","kittyrole",""
"Localized Commands","leaderboard",""
"Localized Commands","map",""
"Localized Commands","perish, thenperish",""
"Localized Commands","ping",""
"Localized Commands","poll",""
"Localized Commands","raffleend",""
"Localized Commands","rafflejoin",""
"Localized Commands","rafflespin",""
"Localized Commands","rafflestart",""
"Localized Commands","rating",""
"Localized Commands","remind",""
"Localized Commands","results",""
"Localized Commands","role",""
"Localized Commands","roll",""
"Localized Commands","rpend",""
"Localized Commands","rpg",""
"Localized Commands","rpstart",""
"Localized Commands","searchcharacter",""
"Localized Commands","showpoll",""
"Localized Commands","shutdown",""
"Localized Commands","stats",""
"Localized Commands","teey",""
"Localized Commands","tony, stark, dontfeelgood, dontfeelsogood","tony, stark, dontfeelgood, dontfeelsogood, snap"
"Localized Commands","tweet",""
"Localized Commands","vote",""
"Localized Commands","wolfram",""
"Localized Commands","work",""
"Localized Commands","yeet",""
"Localized Strings","AddGuildRoleFailure","Failed to add %s to %s"
"Localized Strings","BeansShowDisplay","You have %s beans!"
"Localized Strings","BeansShowInfo","Displays how many beans you have"
"Localized Strings","BeansShowMentioned","I took a look and %sbeans!"
"Localized Strings","BenchmarkInfo","Allows you to lookup PC component benchmarks from UserBenchmark! You can use `bench find <name-snippet>"
"Localized Strings","BenchmarkInvalid","The benchmark operation you were trying to perform was invalid!"
"Localized Strings","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"
"Localized Strings","BetBeansLose","Sorry, you didn't win, try again!"
"Localized Strings","BetBeansLowBet","Please bet with at least 20 beans!"
"Localized Strings","BetBeansNotEnough","You don't have enough beans!"
"Localized Strings","BetBeansNotValid","That's not a valid bet!"
"Localized Strings","BetBeansWin","You won %s beans!"
"Localized Strings","BetHistoryInfo","Gives how many beans I've ~~stolen~~ won from your bets!"
"Localized Strings","BetHistoryOutput","I have %s treats from betting!"
"Localized Strings","BlurryInfo","Blurs your icon or the icon of a friend you mentioned"
"Localized Strings","BoopInfo","Kitty will react with a counter"
"Localized Strings","BoopMultiple","%s booped several others - %s!"
"Localized Strings","BoopPerson","%s booped %s!"
"Localized Strings","BoopStandard","Woah! %s booped me! That's %s total!"
"Localized Strings","CatchInfo","Play catch with yourself or with a friend with @!"
"Localized Strings","ChangeIndicatorChanged","Indicator changed to `%s`"
"Localized Strings","ChangeIndicatorError","Please specify a letter or symbol to use!"
"Localized Strings","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!"
"Localized Strings","CharacterCreateDuplicate",""
"Localized Strings","CharacterCreateInfo",""
"Localized Strings","CharacterCreateNullInfo",""
"Localized Strings","CharacterCreateSuccess",""
"Localized Strings","CharacterEditBioInfo","Change the short bio for your character! "
"Localized Strings","CharacterEditBioNotAuth","You're not authorized to change that character! "
"Localized Strings","CharacterEditBioNotValid",""
"Localized Strings","CharacterEditBioSuccess","Successfully changed your bio! "
"Localized Strings","CharacterEditNameInfo","Change your character's name!"
"Localized Strings","CharacterEditNameNotAuth","You're not authorized to change that character! "
"Localized Strings","CharacterEditNameNotValid","That's not a vaild name!"
"Localized Strings","CharacterEditNameSuccess","Successfully changed your name!"
"Localized Strings","CharacterEditURLInfo","Change the image URL for your character's reference! "
"Localized Strings","CharacterEditURLNotAuth","You're not authorized to change that character! "
"Localized Strings","CharacterEditURLNotValid","That's not a valid url! "
"Localized Strings","CharacterEditURLSuccess","Successfully changed your reference! "
"Localized Strings","CharacterInfo",""
"Localized Strings","CharacterSearchInfo","Find a character with their name or Unique ID! `charactersearch name` or `charactersearch UniqueID`"
"Localized Strings","CharacterSearchMultipleCharacter","%s is owned by %s. Unique ID is `%s`"
"Localized Strings","CharacterSearchMultipleCharacterHeader","I found a couple characters with that name, use `charactersearch UniqueID` with their Unique ID to find them!"
"Localized Strings","CharacterSearchNoCharacterFound","Couldn't find a character with that name or ID!"
"Localized Strings","CharacterSearchOneCharacter","I found one character with that name! n Owner: %s | Name: %s | Bio: %s | Ref: <%s> | Unique ID: `%s`"
"Localized Strings","ChooseChoice","I chooooooose %s!"
"Localized Strings","ChooseInfo","With an input of x,y,z where x y and z are all choices, kitty will choose one"
"Localized Strings","ChooseOne","I can't choose from *one* thing!"
"Localized Strings","ColiruError","Please provide some c++ code to attempt to compile!"
"Localized Strings","ColiruInfo","Will try to compile any c++ code you put in! Supports up to C++14 standard, uses g++."
"Localized Strings","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)"
"Localized Strings","ColorNotSearchable","Your color couldn't be parsed! Make sure it's in hex format. Try this! `!color 3F5D54`"
"Localized Strings","CroutonInfo","Crouton"
"Localized Strings","DBFlushInfo","Takes all objects queued for the database and writes them to the database, then says how many were written."
"Localized Strings","DBStatsInfo","Shows current statistics for the database"
"Localized Strings","DefaultDanceInfo","y'all know forknife, get ready to dance, or make a friend dance with @!"
"Localized Strings","DoWorkFinished","I finished with my work! :D"
"Localized Strings","DoWorkInfo","Occupies a core for a few seconds"
"Localized Strings","EightBallError","Hmm? You'll need to ask a question!"
"Localized Strings","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."
"Localized Strings","EightBallMaybe1","Reply hazy, try again."
"Localized Strings","EightBallMaybe2","Ask again later."
"Localized Strings","EightBallMaybe3","Better not tell you now."
"Localized Strings","EightBallMaybe4","Cannot predict now."
"Localized Strings","EightBallMaybe5","Concentrate and ask again."
"Localized Strings","EightBallNo1","Don't count on it."
"Localized Strings","EightBallNo2","My reply is no."
"Localized Strings","EightBallNo3","My sources say no."
"Localized Strings","EightBallNo4","Outlook not so good."
"Localized Strings","EightBallNo5","Very doubtful."
"Localized Strings","EightBallYes1","It is certain."
"Localized Strings","EightBallYes10","Signs point to yes."
"Localized Strings","EightBallYes2","It is decidedly so."
"Localized Strings","EightBallYes3","Without a doubt."
"Localized Strings","EightBallYes4","Yes - definitely."
"Localized Strings","EightBallYes5","You may rely on it."
"Localized Strings","EightBallYes6","As I see it, yes."
"Localized Strings","EightBallYes7","Most likely."
"Localized Strings","EightBallYes8","Outlook good."
"Localized Strings","EightBallYes9","Yes."
"Localized Strings","FetchBringBack","Got it! %s"
"Localized Strings","FetchBringBackWrong","Got it! %s"
"Localized Strings","FetchCatchRun","*Catches and runs away with %s*"
"Localized Strings","FetchEat","Mine now! *munches on %s*"
"Localized Strings","FetchError","That's not a custom emote!"
"Localized Strings","FetchInfo","Throw a custom emote and I'll try to bring it back.... maybe"
"Localized Strings","FetchRunAway","*Runs away and doesn't return for a long time*"
"Localized Strings","FetchStare","*Stares at %s*"
"Localized Strings","GiveBeansInfo","Gives beans to the mentioned users!"
"Localized Strings","GiveBeansInvalid","That's not a valid number!"
"Localized Strings","GiveBeansNoneMentioned","You didn't mention anyone!"
"Localized Strings","GiveBeansSuccess","Gave %s %s beans!"
"Localized Strings","GuildRoleAddFailure",""
"Localized Strings","GuildRoleAddInfo","Add a role to yourself!"
"Localized Strings","GuildRoleAddNotAllowed","You are not allowed to add %s!"
"Localized Strings","GuildRoleAddSuccess","Added %s to %s"
"Localized Strings","GuildRoleAllowedDuplicate","Can't add the same role twice!"
"Localized Strings","GuildRoleAllowedInfo","Adds role to the list of roles users are allowed to add to themselves."
"Localized Strings","GuildRoleAllowedSuccess","Added %s to the allowed roles!"
"Localized Strings","GuildRoleInfo",""
"Localized Strings","GuildRoleListEmpty",""
"Localized Strings","GuildRoleListOutput","You can add these roles! %s"
"Localized Strings","GuildRoleNotAllowedFailure","Unable to remove %s from the list!"
"Localized Strings","GuildRoleNotAllowedInfo","Removes a role from the list that users are allowed to add to themselves."
"Localized Strings","GuildRoleNotAllowedNoArgs",""
"Localized Strings","GuildRoleNotAllowedSuccess","Removed %s from the allowed roles!"
"Localized Strings","GuildRoleRemoveFailure","I wasn't able to remove %s from %s!"
"Localized Strings","GuildRoleRemoveInfo","Removes a role from you! Just remember to spell it right!"
"Localized Strings","GuildRoleRemoveNotAllowed","You're not allowed to add %s!"
"Localized Strings","GuildRoleRemoveSuccess","Removed %s from %s!"
"Localized Strings","HelpBuilderInfo","Emit help for all commands as formatted HTML"
"Localized Strings","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`"
"Localized Strings","HelpInfo","Lets you look up specific commands, or get a link to a list of all commands."
"Localized Strings","InfoInfo","Provides author info and a link to Kitty's website"
"Localized Strings","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"
"Localized Strings","InviteInfo","Provides a direct invite link for KittyBot"
"Localized Strings","JDoodleError","Please provide some java code to get it compiled!"
"Localized Strings","JDoodleInfo","Will compile any java code you put in! Supports Java 1.8"
"Localized Strings","LeaderboardInfo","Shows you the 10 users with the most beans on the server"
"Localized Strings","LeaderboardTitle","Server Leaderboard"
"Localized Strings","MapHeight",""
"Localized Strings","MapInfo","Generates a map! You can pass additional information if you want with the flags `-s<seed>`. If one of the fields isn't provided, its default will be used. Note that adjusting the width and height impacts the map outcomes.nn**Defaults**nDefault Seed: Random,nDefault Width: 35(max %s),nDefault Height: 25(max %s)nn**Key**nLand: ~nMountain: ▲nBeach: "
"Localized Strings","MapInvalid","Invalid arguments provided!"
"Localized Strings","MapSeed","Seed"
"Localized Strings","MapVersion","Using mapgen v0.1"
"Localized Strings","MapWidth",""
"Localized Strings","PerishInfo","Adds a red, 'a n g e r y' overlay to your icon or the icon of a friend you mentioned"
"Localized Strings","PingInfo","Will respond with Pong!"
"Localized Strings","PingResponse","Pong!"
"Localized Strings","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"
"Localized Strings","PollResultsInfo","Will show current results of a poll and percentages of votes per choice"
"Localized Strings","PollResultsResponse","%s people voted for %s `%s` with `%s%` !n"
"Localized Strings","PollShowChoices","And the choices are:n"
"Localized Strings","PollShowInfo","Will show the current poll running"
"Localized Strings","PollShowNoPoll","There is no poll running!"
"Localized Strings","PollShowPoll","The current poll is `%s`n"
"Localized Strings","PollVoteAlreadyVoted","You already voted"
"Localized Strings","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!"
"Localized Strings","PollVoteNoPoll","There is no poll running!"
"Localized Strings","PollVoteNotValidNumber","That's not a vaild number!"
"Localized Strings","PollVoteNotValidVote","%s That's not a vaild vote!"
"Localized Strings","PollVoteSuccess","You successfully voted for"
"Localized Strings","RaffleEndFailure","I don't think there's one going!"
"Localized Strings","RaffleEndInfo",""
"Localized Strings","RaffleEndSuccess",""
"Localized Strings","RaffleJoinFailure",""
"Localized Strings","RaffleJoinInfo",""
"Localized Strings","RaffleJoinSuccess",""
"Localized Strings","RaffleSpinFailure","I can't choose a winner D:"
"Localized Strings","RaffleSpinInfo",""
"Localized Strings","RaffleSpinSuccess","The winner issssssss %s!"
"Localized Strings","RaffleStartFailure",""
"Localized Strings","RaffleStartInfo",""
"Localized Strings","RaffleStartSuccess",""
"Localized Strings","RatingChanged","Kittybot content set to %s"
"Localized Strings","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."
"Localized Strings","RatingInvalid","Invalid content rating"
"Localized Strings","RatingWarning","Warning: NSFW may slip through, images are only based on tags on their respective sites!"
"Localized Strings","RemindInfo",""
"Localized Strings","RoleChanged","Changed %s to role `%s`!"
"Localized Strings","RoleError","You aren't allowed to do that! You must have the KittyRole '%' or higher!"
"Localized Strings","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."
"Localized Strings","RoleNeededRole","Please enter `general`, `mod`, or `admin`!"
"Localized Strings","RoleStandardResponse","Your role is %s"
"Localized Strings","RollError","Didn't work ;3;"
"Localized Strings","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"
"Localized Strings","RPEndError","You can't end this RP!"
"Localized Strings","RPEndFileOut","Here's your file!"
"Localized Strings","RPEndInfo","Ends RP in channel and gives you a .txt file!"
"Localized Strings","RPGInfo","Admin+ command only right now - experimental text RPG! Format is !rpg <rpg command>"
"Localized Strings","RPGInvalid","Invalid RPG Command!"
"Localized Strings","RPStartInfo","Starts an rp, add people to it by mentioning them!"
"Localized Strings","ShutdownInfo","Stops kitty. `-s` or `safe` as an argument attempts to sync off the database before shutdown."
"Localized Strings","ShutdownSafe",""
"Localized Strings","ShutdownUnsafe",""
"Localized Strings","StarkInfo","Snaps your icon or the icon of a friend you mentioned"
"Localized Strings","StatsInfo","Displays the actively running KittyBot application information"
"Localized Strings","TeeyInfo","Teey yourself back into existance, or teey a friend with @!"
"Localized Strings","TradeBeansInfo","Give your friends some of your beans! Just don't forget to @ them!"
"Localized Strings","TradeBeansIntParseError","That's not a real number! D:"
"Localized Strings","TradeBeansNoTargetError","Don't forget to tag who you want to give the beans to!"
"Localized Strings","TradeBeansNotEnoughError","You can't give more beans than you have!"
"Localized Strings","TradeBeansStealingBeans","Hey %s! Stealing is wrong! Let's see how you like it! *steals 10 beans*"
"Localized Strings","TradeBeansSuccess","%s gave %s %s beans!"
"Localized Strings","TweetError","Tweet command failed!"
"Localized Strings","TweetInfo","Kitty will tweet to her personal twitter account"
"Localized Strings","WolframError","Something went wrong!"
"Localized Strings","WolframInfo","Will query wolframalpha with your question and give a full image output of the answer"
"Localized Strings","WolframNoArgs","You need to provide some arguments!"
"Localized Strings","YeetInfo","Yeet yourself or yeet a friend with @!"
"Command Enabler","addguildrole","1"
"Command Enabler","allowedguildrole","1"
"Command Enabler","beans","1"
"Command Enabler","benchmark, bench","1"
"Command Enabler","bet","1"
"Command Enabler","bethistory","1"
"Command Enabler","blur","1"
"Command Enabler","boop","1"
"Command Enabler","buildhelp","1"
"Command Enabler","c++, g++, cplus, cpp","1"
"Command Enabler","catch","1"
"Command Enabler","charactercreate","1"
"Command Enabler","charactereditbio","1"
"Command Enabler","charactereditname","1"
"Command Enabler","characterediturl","1"
"Command Enabler","choose","1"
"Command Enabler","color, colour","1"
"Command Enabler","crouton","1"
"Command Enabler","dbflush","1"
"Command Enabler","dbstats","1"
"Command Enabler","defaultdance","1"
"Command Enabler","derp","1"
"Command Enabler","e621","1"
"Command Enabler","eightball, 8ball","1"
"Command Enabler","fetch","1"
"Command Enabler","givebeans","1"
"Command Enabler","guildroleadd","1"
"Command Enabler","guildroleallowed","1"
"Command Enabler","guildrolelist","1"
"Command Enabler","guildrolenotallowed","1"
"Command Enabler","guildroleremove","1"
"Command Enabler","help","1"
"Command Enabler","indicator","1"
"Command Enabler","info, about","1"
"Command Enabler","invite","1"
"Command Enabler","java, jdoodle","1"
"Command Enabler","kittyrole","1"
"Command Enabler","leaderboard","1"
"Command Enabler","map","1"
"Command Enabler","perish, thenperish","1"
"Command Enabler","ping","1"
"Command Enabler","poll","1"
"Command Enabler","raffleend","1"
"Command Enabler","rafflejoin","1"
"Command Enabler","rafflespin","1"
"Command Enabler","rafflestart","1"
"Command Enabler","rating","1"
"Command Enabler","remind","1"
"Command Enabler","results","1"
"Command Enabler","role","1"
"Command Enabler","roll","1"
"Command Enabler","rpend","1"
"Command Enabler","rpg","1"
"Command Enabler","rpstart","1"
"Command Enabler","searchcharacter","1"
"Command Enabler","showpoll","1"
"Command Enabler","shutdown","1"
"Command Enabler","stats","1"
"Command Enabler","teey","1"
"Command Enabler","tony, stark, dontfeelgood, dontfeelsogood","1"
"Command Enabler","tweet","1"
"Command Enabler","vote","1"
"Command Enabler","wolfram","1"
"Command Enabler","work","1"
"Command Enabler","yeet","1"
1 Type Key Value
2 Localized Commands beans
3 Localized Commands benchmark, bench
4 Localized Commands bet
5 Localized Commands bethistory
6 Localized Commands blur
7 Localized Commands boop
8 Localized Commands buildHelp
9 Localized Commands c++, g++, cplus, cpp
10 Localized Commands catch
11 Localized Commands charactercreate
12 Localized Commands charactereditbio
13 Localized Commands charactereditname
14 Localized Commands charactereditURL
15 Localized Commands choose
16 Localized Commands color, colour
17 Localized Commands crouton
18 Localized Commands dbflush
19 Localized Commands dbstats
20 Localized Commands defaultdance
21 Localized Commands derp
22 Localized Commands e621
23 Localized Commands eightball, 8ball
24 Localized Commands fetch
25 Localized Commands givebeans
26 Localized Commands guildroleadd
27 Localized Commands guildroleallowed
28 Localized Commands guildrolelist
29 Localized Commands guildrolenotallowed guildrolenotallowed, rolelistremove
30 Localized Commands guildroleremove
31 Localized Commands help
32 Localized Commands indicator
33 Localized Commands info, about
34 Localized Commands invite
35 Localized Commands java, jdoodle
36 Localized Commands kittyrole
37 Localized Commands leaderboard
38 Localized Commands map
39 Localized Commands perish, thenperish
40 Localized Commands ping
41 Localized Commands poll
42 Localized Commands raffleend
43 Localized Commands rafflejoin
44 Localized Commands rafflespin
45 Localized Commands rafflestart
46 Localized Commands rating
47 Localized Commands remind
48 Localized Commands results
49 Localized Commands role
50 Localized Commands roll
51 Localized Commands rpend
52 Localized Commands rpg
53 Localized Commands rpstart
54 Localized Commands searchcharacter
55 Localized Commands showpoll
56 Localized Commands shutdown
57 Localized Commands stats
58 Localized Commands teey
59 Localized Commands tony, stark, dontfeelgood, dontfeelsogood tony, stark, dontfeelgood, dontfeelsogood, snap
60 Localized Commands tweet
61 Localized Commands vote
62 Localized Commands wolfram
63 Localized Commands work
64 Localized Commands yeet
65 Localized Strings AddGuildRoleFailure Failed to add %s to %s
66 Localized Strings BeansShowDisplay You have %s beans!
67 Localized Strings BeansShowInfo Displays how many beans you have
68 Localized Strings BeansShowMentioned I took a look and %sbeans!
69 Localized Strings BenchmarkInfo Allows you to lookup PC component benchmarks from UserBenchmark! You can use `bench find <name-snippet>
70 Localized Strings BenchmarkInvalid The benchmark operation you were trying to perform was invalid!
71 Localized Strings 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
72 Localized Strings BetBeansLose Sorry, you didn't win, try again!
73 Localized Strings BetBeansLowBet Please bet with at least 20 beans!
74 Localized Strings BetBeansNotEnough You don't have enough beans!
75 Localized Strings BetBeansNotValid That's not a valid bet!
76 Localized Strings BetBeansWin You won %s beans!
77 Localized Strings BetHistoryInfo Gives how many beans I've ~~stolen~~ won from your bets!
78 Localized Strings BetHistoryOutput I have %s treats from betting!
79 Localized Strings BlurryInfo Blurs your icon or the icon of a friend you mentioned
80 Localized Strings BoopInfo Kitty will react with a counter
81 Localized Strings BoopMultiple %s booped several others - %s!
82 Localized Strings BoopPerson %s booped %s!
83 Localized Strings BoopStandard Woah! %s booped me! That's %s total!
84 Localized Strings CatchInfo Play catch with yourself or with a friend with @!
85 Localized Strings ChangeIndicatorChanged Indicator changed to `%s`
86 Localized Strings ChangeIndicatorError Please specify a letter or symbol to use!
87 Localized Strings 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!
88 Localized Strings CharacterCreateDuplicate
89 Localized Strings CharacterCreateInfo
90 Localized Strings CharacterCreateNullInfo
91 Localized Strings CharacterCreateSuccess
92 Localized Strings CharacterEditBioInfo Change the short bio for your character!
93 Localized Strings CharacterEditBioNotAuth You're not authorized to change that character!
94 Localized Strings CharacterEditBioNotValid
95 Localized Strings CharacterEditBioSuccess Successfully changed your bio!
96 Localized Strings CharacterEditNameInfo Change your character's name!
97 Localized Strings CharacterEditNameNotAuth You're not authorized to change that character!
98 Localized Strings CharacterEditNameNotValid That's not a vaild name!
99 Localized Strings CharacterEditNameSuccess Successfully changed your name!
100 Localized Strings CharacterEditURLInfo Change the image URL for your character's reference!
101 Localized Strings CharacterEditURLNotAuth You're not authorized to change that character!
102 Localized Strings CharacterEditURLNotValid That's not a valid url!
103 Localized Strings CharacterEditURLSuccess Successfully changed your reference!
104 Localized Strings CharacterInfo
105 Localized Strings CharacterSearchInfo Find a character with their name or Unique ID! `charactersearch name` or `charactersearch UniqueID`
106 Localized Strings CharacterSearchMultipleCharacter %s is owned by %s. Unique ID is `%s`
107 Localized Strings CharacterSearchMultipleCharacterHeader I found a couple characters with that name, use `charactersearch UniqueID` with their Unique ID to find them!
108 Localized Strings CharacterSearchNoCharacterFound Couldn't find a character with that name or ID!
109 Localized Strings CharacterSearchOneCharacter I found one character with that name! n Owner: %s | Name: %s | Bio: %s | Ref: <%s> | Unique ID: `%s`
110 Localized Strings ChooseChoice I chooooooose %s!
111 Localized Strings ChooseInfo With an input of x,y,z where x y and z are all choices, kitty will choose one
112 Localized Strings ChooseOne I can't choose from *one* thing!
113 Localized Strings ColiruError Please provide some c++ code to attempt to compile!
114 Localized Strings ColiruInfo Will try to compile any c++ code you put in! Supports up to C++14 standard, uses g++.
115 Localized Strings 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)
116 Localized Strings ColorNotSearchable Your color couldn't be parsed! Make sure it's in hex format. Try this! `!color 3F5D54`
117 Localized Strings CroutonInfo Crouton
118 Localized Strings DBFlushInfo Takes all objects queued for the database and writes them to the database, then says how many were written.
119 Localized Strings DBStatsInfo Shows current statistics for the database
120 Localized Strings DefaultDanceInfo y'all know forknife, get ready to dance, or make a friend dance with @!
121 Localized Strings DoWorkFinished I finished with my work! :D
122 Localized Strings DoWorkInfo Occupies a core for a few seconds
123 Localized Strings EightBallError Hmm? You'll need to ask a question!
124 Localized Strings 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.
125 Localized Strings EightBallMaybe1 Reply hazy, try again.
126 Localized Strings EightBallMaybe2 Ask again later.
127 Localized Strings EightBallMaybe3 Better not tell you now.
128 Localized Strings EightBallMaybe4 Cannot predict now.
129 Localized Strings EightBallMaybe5 Concentrate and ask again.
130 Localized Strings EightBallNo1 Don't count on it.
131 Localized Strings EightBallNo2 My reply is no.
132 Localized Strings EightBallNo3 My sources say no.
133 Localized Strings EightBallNo4 Outlook not so good.
134 Localized Strings EightBallNo5 Very doubtful.
135 Localized Strings EightBallYes1 It is certain.
136 Localized Strings EightBallYes10 Signs point to yes.
137 Localized Strings EightBallYes2 It is decidedly so.
138 Localized Strings EightBallYes3 Without a doubt.
139 Localized Strings EightBallYes4 Yes - definitely.
140 Localized Strings EightBallYes5 You may rely on it.
141 Localized Strings EightBallYes6 As I see it, yes.
142 Localized Strings EightBallYes7 Most likely.
143 Localized Strings EightBallYes8 Outlook good.
144 Localized Strings EightBallYes9 Yes.
145 Localized Strings FetchBringBack Got it! %s
146 Localized Strings FetchBringBackWrong Got it! %s
147 Localized Strings FetchCatchRun *Catches and runs away with %s*
148 Localized Strings FetchEat Mine now! *munches on %s*
149 Localized Strings FetchError That's not a custom emote!
150 Localized Strings FetchInfo Throw a custom emote and I'll try to bring it back.... maybe
151 Localized Strings FetchRunAway *Runs away and doesn't return for a long time*
152 Localized Strings FetchStare *Stares at %s*
153 Localized Strings GiveBeansInfo Gives beans to the mentioned users!
154 Localized Strings GiveBeansInvalid That's not a valid number!
155 Localized Strings GiveBeansNoneMentioned You didn't mention anyone!
156 Localized Strings GiveBeansSuccess Gave %s %s beans!
157 Localized Strings GuildRoleAddFailure
158 Localized Strings GuildRoleAddInfo Add a role to yourself!
159 Localized Strings GuildRoleAddNotAllowed You are not allowed to add %s!
160 Localized Strings GuildRoleAddSuccess Added %s to %s
161 Localized Strings GuildRoleAllowedDuplicate Can't add the same role twice!
162 Localized Strings GuildRoleAllowedInfo Adds role to the list of roles users are allowed to add to themselves.
163 Localized Strings GuildRoleAllowedSuccess Added %s to the allowed roles!
164 Localized Strings GuildRoleInfo
165 Localized Strings GuildRoleListEmpty
166 Localized Strings GuildRoleListOutput You can add these roles! %s
167 Localized Strings GuildRoleNotAllowedFailure Unable to remove %s from the list!
168 Localized Strings GuildRoleNotAllowedInfo Removes a role from the list that users are allowed to add to themselves.
169 Localized Strings GuildRoleNotAllowedNoArgs
170 Localized Strings GuildRoleNotAllowedSuccess Removed %s from the allowed roles!
171 Localized Strings GuildRoleRemoveFailure I wasn't able to remove %s from %s!
172 Localized Strings GuildRoleRemoveInfo Removes a role from you! Just remember to spell it right!
173 Localized Strings GuildRoleRemoveNotAllowed You're not allowed to add %s!
174 Localized Strings GuildRoleRemoveSuccess Removed %s from %s!
175 Localized Strings HelpBuilderInfo Emit help for all commands as formatted HTML
176 Localized Strings 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`
177 Localized Strings HelpInfo Lets you look up specific commands, or get a link to a list of all commands.
178 Localized Strings InfoInfo Provides author info and a link to Kitty's website
179 Localized Strings 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
180 Localized Strings InviteInfo Provides a direct invite link for KittyBot
181 Localized Strings JDoodleError Please provide some java code to get it compiled!
182 Localized Strings JDoodleInfo Will compile any java code you put in! Supports Java 1.8
183 Localized Strings LeaderboardInfo Shows you the 10 users with the most beans on the server
184 Localized Strings LeaderboardTitle Server Leaderboard
185 Localized Strings MapHeight
186 Localized Strings MapInfo Generates a map! You can pass additional information if you want with the flags `-s<seed>`. If one of the fields isn't provided, its default will be used. Note that adjusting the width and height impacts the map outcomes.nn**Defaults**nDefault Seed: Random,nDefault Width: 35(max %s),nDefault Height: 25(max %s)nn**Key**nLand: ~nMountain: ▲nBeach:
187 Localized Strings MapInvalid Invalid arguments provided!
188 Localized Strings MapSeed Seed
189 Localized Strings MapVersion Using mapgen v0.1
190 Localized Strings MapWidth
191 Localized Strings PerishInfo Adds a red, 'a n g e r y' overlay to your icon or the icon of a friend you mentioned
192 Localized Strings PingInfo Will respond with Pong!
193 Localized Strings PingResponse Pong!
194 Localized Strings 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
195 Localized Strings PollResultsInfo Will show current results of a poll and percentages of votes per choice
196 Localized Strings PollResultsResponse %s people voted for %s `%s` with `%s%` !n
197 Localized Strings PollShowChoices And the choices are:n
198 Localized Strings PollShowInfo Will show the current poll running
199 Localized Strings PollShowNoPoll There is no poll running!
200 Localized Strings PollShowPoll The current poll is `%s`n
201 Localized Strings PollVoteAlreadyVoted You already voted
202 Localized Strings 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!
203 Localized Strings PollVoteNoPoll There is no poll running!
204 Localized Strings PollVoteNotValidNumber That's not a vaild number!
205 Localized Strings PollVoteNotValidVote %s That's not a vaild vote!
206 Localized Strings PollVoteSuccess You successfully voted for
207 Localized Strings RaffleEndFailure I don't think there's one going!
208 Localized Strings RaffleEndInfo
209 Localized Strings RaffleEndSuccess
210 Localized Strings RaffleJoinFailure
211 Localized Strings RaffleJoinInfo
212 Localized Strings RaffleJoinSuccess
213 Localized Strings RaffleSpinFailure I can't choose a winner D:
214 Localized Strings RaffleSpinInfo
215 Localized Strings RaffleSpinSuccess The winner issssssss %s!
216 Localized Strings RaffleStartFailure
217 Localized Strings RaffleStartInfo
218 Localized Strings RaffleStartSuccess
219 Localized Strings RatingChanged Kittybot content set to %s
220 Localized Strings 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.
221 Localized Strings RatingInvalid Invalid content rating
222 Localized Strings RatingWarning Warning: NSFW may slip through, images are only based on tags on their respective sites!
223 Localized Strings RemindInfo
224 Localized Strings RoleChanged Changed %s to role `%s`!
225 Localized Strings RoleError You aren't allowed to do that! You must have the KittyRole '%' or higher!
226 Localized Strings 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.
227 Localized Strings RoleNeededRole Please enter `general`, `mod`, or `admin`!
228 Localized Strings RoleStandardResponse Your role is %s
229 Localized Strings RollError Didn't work ;3;
230 Localized Strings 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
231 Localized Strings RPEndError You can't end this RP!
232 Localized Strings RPEndFileOut Here's your file!
233 Localized Strings RPEndInfo Ends RP in channel and gives you a .txt file!
234 Localized Strings RPGInfo Admin+ command only right now - experimental text RPG! Format is !rpg <rpg command>
235 Localized Strings RPGInvalid Invalid RPG Command!
236 Localized Strings RPStartInfo Starts an rp, add people to it by mentioning them!
237 Localized Strings ShutdownInfo Stops kitty. `-s` or `safe` as an argument attempts to sync off the database before shutdown.
238 Localized Strings ShutdownSafe
239 Localized Strings ShutdownUnsafe
240 Localized Strings StarkInfo Snaps your icon or the icon of a friend you mentioned
241 Localized Strings StatsInfo Displays the actively running KittyBot application information
242 Localized Strings TeeyInfo Teey yourself back into existance, or teey a friend with @!
243 Localized Strings TradeBeansInfo Give your friends some of your beans! Just don't forget to @ them!
244 Localized Strings TradeBeansIntParseError That's not a real number! D:
245 Localized Strings TradeBeansNoTargetError Don't forget to tag who you want to give the beans to!
246 Localized Strings TradeBeansNotEnoughError You can't give more beans than you have!
247 Localized Strings TradeBeansStealingBeans Hey %s! Stealing is wrong! Let's see how you like it! *steals 10 beans*
248 Localized Strings TradeBeansSuccess %s gave %s %s beans!
249 Localized Strings TweetError Tweet command failed!
250 Localized Strings TweetInfo Kitty will tweet to her personal twitter account
251 Localized Strings WolframError Something went wrong!
252 Localized Strings WolframInfo Will query wolframalpha with your question and give a full image output of the answer
253 Localized Strings WolframNoArgs You need to provide some arguments!
254 Localized Strings YeetInfo Yeet yourself or yeet a friend with @!
255 Command Enabler addguildrole 1
256 Command Enabler allowedguildrole 1
257 Command Enabler beans 1
258 Command Enabler benchmark, bench 1
259 Command Enabler bet 1
260 Command Enabler bethistory 1
261 Command Enabler blur 1
262 Command Enabler boop 1
263 Command Enabler buildhelp 1
264 Command Enabler c++, g++, cplus, cpp 1
265 Command Enabler catch 1
266 Command Enabler charactercreate 1
267 Command Enabler charactereditbio 1
268 Command Enabler charactereditname 1
269 Command Enabler characterediturl 1
270 Command Enabler choose 1
271 Command Enabler color, colour 1
272 Command Enabler crouton 1
273 Command Enabler dbflush 1
274 Command Enabler dbstats 1
275 Command Enabler defaultdance 1
276 Command Enabler derp 1
277 Command Enabler e621 1
278 Command Enabler eightball, 8ball 1
279 Command Enabler fetch 1
280 Command Enabler givebeans 1
281 Command Enabler guildroleadd 1
282 Command Enabler guildroleallowed 1
283 Command Enabler guildrolelist 1
284 Command Enabler guildrolenotallowed 1
285 Command Enabler guildroleremove 1
286 Command Enabler help 1
287 Command Enabler indicator 1
288 Command Enabler info, about 1
289 Command Enabler invite 1
290 Command Enabler java, jdoodle 1
291 Command Enabler kittyrole 1
292 Command Enabler leaderboard 1
293 Command Enabler map 1
294 Command Enabler perish, thenperish 1
295 Command Enabler ping 1
296 Command Enabler poll 1
297 Command Enabler raffleend 1
298 Command Enabler rafflejoin 1
299 Command Enabler rafflespin 1
300 Command Enabler rafflestart 1
301 Command Enabler rating 1
302 Command Enabler remind 1
303 Command Enabler results 1
304 Command Enabler role 1
305 Command Enabler roll 1
306 Command Enabler rpend 1
307 Command Enabler rpg 1
308 Command Enabler rpstart 1
309 Command Enabler searchcharacter 1
310 Command Enabler showpoll 1
311 Command Enabler shutdown 1
312 Command Enabler stats 1
313 Command Enabler teey 1
314 Command Enabler tony, stark, dontfeelgood, dontfeelsogood 1
315 Command Enabler tweet 1
316 Command Enabler vote 1
317 Command Enabler wolfram 1
318 Command Enabler work 1
319 Command Enabler yeet 1
-61
View File
@@ -1,61 +0,0 @@
[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=
role=
raffleend=
ping=
charactereditbio=
roll=
blur=
choose=
rpstart=
guildrolenotallowed=
perish, thenperish=
teey=
searchcharacter=
dbstats=
rafflestart=
beans=
eightball, 8ball=
vote=
map=
info, about=
showpoll=
rpg=
tweet=
charactercreate=
help=
charactereditname=
fetch=
crouton=
invite=
-309
View File
@@ -1,309 +0,0 @@
[CommandBenchmark]
BenchmarkInfo=Allows you to lookup PC component benchmarks from UserBenchmark! You can use `bench find <name-snippet>` to see what's in the database, `bench info <name-snippet>` to look at a specific component, or the experimental `bench compare` commands!
BenchmarkInvalid=The benchmark operation you were trying to perform was invalid!
[CommandPollManage]
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
[CommandGuildRoleNotAllowed]
GuildRoleNotAllowedFailure=
GuildRoleNotAllowedSuccess=
GuildRoleNotAllowedInfo=
[CommandBetHistory]
BetHistoryOutput=Kitty has %s beans!
BetHistoryInfo=Sees the amount of beans Kitty has earned through your bets!
[CommandCatch]
CatchInfo=Play catch with yourself or with a friend with @!
[CommandLeaderboard]
LeaderboardInfo=Shows you the 10 users with the most beans on the server
LeaderboardTitle=Server Leaderboard
[CommandGuildRoleList]
GuildRoleListOutput=The allowed roles are %s!
GuildRoleListEmpty=There are no roles allowed!
GuildRoleListInfo=Outputs a list of the roles you are allowed to add to yourself!
[CommandRoll]
RollError=Didn't work ;3;
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
[CommandGuildRoleAllowed]
GuildRoleAllowedInfo=
GuildRoleAllowedSuccess=Added %s to the allowed roles!
GuildRoleAllowedDuplicate=Can't add the same role twice!
[CommandStats]
StatsInfo=Displays the actively running KittyBot application information
[CommandRole]
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.
RoleStandardResponse=Your role is %s
RoleError=You aren't allowed to do that! You must have the KittyRole '%s' or higher!
RoleChanged=Changed %s to role `%s`!
RoleNeededRole=Please enter `general`, `mod`, or `admin`!
[CommandJDoodle]
JDoodleInfo=Will compile any java code you put in! Supports Java 1.8
JDoodleError=Please provide some java code to get it compiled!
[CommandChangeIndicator]
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!
ChangeIndicatorError=Please specify a letter or symbol to use!
ChangeIndicatorChanged=Indicator changed to `%s`
[CommandPerish]
PerishInfo=Adds a red, 'a n g e r y' overlay to your icon or the icon of a friend you mentioned
[CommandTradeBeans]
TradeBeanseStealingBeans=Stealing is wrong! *Steals 10 beans from %s*
TradeBeansNoTargetError=You have to give *someone* your beans!
TradeBeansSuccess=%s gave %s %s of their beans!
TradeBeansStealingBeans=
TradeBeansInfo=Gives another person some of your beans! Use is `tradebeans amount @person`!
TradeBeansIntParseError=That's not a real number!
TradeBeansNotEnoughError=You don't have enough beans!
[CommandPollVote]
PollVoteNotValidNumber=That's not a vaild number!
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!
PollVoteNoPoll=There is no poll running!
PollVoteAlreadyVoted=You already voted
PollVoteNotValidVote=%s That's not a vaild vote!
PollVoteSuccess=You successfully voted for
[CommandShutdown]
ShutdownSafe=Shutting down, but first syncing database and finishing current threads.
ShutdownUnsafe=Shutting down and immediately and abandoning all threads without sync.
ShutdownInfo=Stops kitty. `-s` or `safe` as an argument attempts to sync off the database before shutdown.
[CommandRaffleSpin]
RaffleSpinInfo=
RaffleSpinSuccess=The winner issssssss %s!
RaffleSpinFailure=I can't choose a winner D:
[CommandRaffleEnd]
RaffleEndSuccess=
RaffleEndInfo=
RaffleEndFailure=I don't think there's one going!
[CommandCharacterSearch]
CharacterSearchNoCharacterFound=Couldn't find a character with that name or ID!
CharacterSearchMultipleCharacterHeader=I found a couple characters with that name, use `charactersearch UniqueID` with their Unique ID to find them!
CharacterSearchMultipleCharacter=%s is owned by %s. Unique ID is `%s`
CharacterSearchOneCharacter=I found one character with that name! \n Owner: %s | Name: %s | Bio: %s | Ref: <%s> | Unique ID: `%s`
CharacterSearchInfo=Find a character with their name or Unique ID! `charactersearch name` or `charactersearch UniqueID`
[CommandColor]
ColorNotSearchable=Your color couldn't be parsed! Make sure it's in hex format. Try this! `!color 3F5D54`
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)
[CommandDoWork]
DoWorkFinished=I finished with my work! :D
DoWorkInfo=Occupies a core for a few seconds
[CommandRPStart]
RPStartInfo=Starts an rp, add people to it by mentioning them!
[CommandBlurry]
BlurryInfo=Blurs your icon or the icon of a friend you mentioned
[CommandRating]
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=Warning: NSFW may slip through, images are only based on tags on their respective sites!
RatingChanged=Kittybot content set to
RatingInvalid=Invalid content rating
[CommandDBStats]
DBStatsInfo=
[CommandGiveBeans]
GiveBeansNoneMentioned=You didn't mention anyone!
GiveBeansSuccess=Gave %s %s beans!
GiveBeansInvalid=That's not a valid number!
GiveBeansInfo=Gives beans to the mentioned users!
[CommandPollShow]
PollShowNoPoll=There is no poll running!
PollShowInfo=Will show the current poll running
PollShowPoll=The current poll is `%s`\n
PollShowChoices=And the choices are:\n
[CommandHelpBuilder]
HelpBuilderInfo=Emit help for all commands as formatted HTML
[CommandCharacterEditURL]
CharacterEditURLInfo=
CharacterEditURLNotValid=
CharacterEditURLSuccess=
CharacterEditURLNotAuth=
CharacterEditURLIDNotValid=
[CommandRPG]
RPGInfo=Admin+ command only right now - experimental text RPG! Format is !rpg <rpg command>
RPGInvalid=Invalid RPG Command!
[CommandFetch]
FetchError=That no picture!
FetchEat=Me eat now *monch %s*
FetchInfo=Throw a custom emote and me bring it back!
FetchCatchRun=*Catches and runs away with %s*
FetchRunAway=*Runs away and doesn't return for a long time*
FetchBringBack=Me gots it! %s
FetchBringBackWrong=Me gots it! %s
FetchStare=*Stares at %s*
[CommandInfo]
InfoResponse=I'm made by `Rin#8904` and `Reverie Wisp#3703`!\nYou can find more info about me along with a Patreon link to support us and GitHub link for filing bugs https://www.rinsnowmew.com/bot/
InfoInfo=Provides author info and a link to Kitty's website
[CommandGuildRoleRemove]
GuildRoleRemoveNotAllowed=You're not allowed to add %s
GuildRoleRemoveFailure=Couldn't remove %s from %s
GuildRoleRemoveSuccess=Removed %s from %s!
GuildRoleRemoveInfo=Removes the role specified!
[CommandWolfram]
WolframError=Something went wrong!
WolframInfo=Will query wolframalpha with your question and give a full image output of the answer
WolframNoArgs=You need to provide some arguments!
[CommandMap]
MapInfo=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\n**Defaults**\nDefault Seed: Random,\nDefault Width: 35(max %s),\nDefault Height: 25(max %s)\n\n**Key**\nLand: ˶\nMountain: ▲\nBeach: =\nMarsh: ¥\nLava: #
MapSeed=Seed
MapInvalid=Invalid arguments provided!
MapVersion=Using mapgen v0.1
MapWidth=Width
MapHeight=Height
[CommandBeansShow]
BeansShowDisplay=You have %s beans!
BeansShowMentioned=I looked it up and %sbeans!
BeansShowInfo=Displays how many beans you have
[CommandRaffleStart]
RaffleStartSuccess=Started a raffle with an entrance fee of %s beans!
RaffleStartFailure=There's already a raffle going!
RaffleStart=
RaffleStartInfo=
[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`!\nGeneral Commands: `boop, roll, choose, help, info, vote, results, showpoll, wolfram, cplus, java, beans, role, bet, yeet`
[CommandCharacterEditBio]
CharacterEditBioSuccess=
CharacterEditBioIDNotValid=
CharacterEditBioNotAuth=
CharacterEditBioInfo=
CharacterEditBioNotValid=
[CommandTweet]
TweetInfo=Kitty will tweet to her personal twitter account
TweetError=Tweet command failed!
[CommandGuildRoleAdd]
GuildRoleAddSuccess=Added %s to %s
GuildRoleAddFailure=Failed to add %s to %s
GuildRoleAddNotAllowed=You are not allowed to add %s!
GuildRoleAddInfo=Add a role to yourself!
[CommandCharacterEditName]
CharacterEditNameInfo=
CharacterEditNameNotValid=
CharacterEditNameIDNotValid=
CharacterEditNameSuccess=
CharacterEditNameNotAuth=
[CommandColiru]
ColiruError=Please provide some c++ code to attempt to compile!
ColiruInfo=Will try to compile any c++ code you put in! Supports up to C++14 standard, uses g++.
[CommandStark]
StarkInfo=Snaps your icon or the icon of a friend you mentioned
[CommandYeet]
YeetInfo=Yeet yourself or yeet a friend with @!
[CommandCrouton]
CroutonInfo=Crouton
[CommandCharacterCreate]
CharacterCreateDuplicate=You can't create a character with the same name!
CharacterCreateInfo=Create a character for kitty to hold onto for you! `createcharacter name, shortbio, refURL`
CharacterCreateSuccess=You successfully created a character!
CharacterCreateNullInfo=There's not enough info!
[CommandTeey]
TeeyInfo=Teey yourself back into existance, or teey a friend with @!
[CommandBetBeans]
BetBeansLowBet=Please bet with at least 50 beans!
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
BetBeansNotValid=That's not a valid bet!
BetBeansLose=Sorry, you didn't win, try again!
BetBeansNotEnough=You don't have enough beans!
BetBeansWin=You won %s beans!
[CommandPollResults]
PollResultsResponse=%s people voted for %s `%s` with `%s%` !\n
PollResultsInfo=Will show current results of a poll and percentages of votes per choice
[CommandRPEnd]
RPEndError=You can't end this RP!
RPEndInfo=Ends RP in channel and gives you a .txt file!
RPEndFileOut=Here's your file!
[CommandBoop]
BoopPerson=%s booped %s!
BoopInfo=Kitty will react with a counter
BoopStandard=Woah! %s booped me! That's %s total!
BoopMultiple=%s booped several others - %s!
[CommandPing]
PingResponse=Pong!
PingInfo=Will respond with Pong!
[CommandChoose]
ChooseChoice=I chooooooose %s!
ChooseOne=I can't choose from *one* thing!
ChooseInfo=With an input of x,y,z where x y and z are all choices, kitty will choose one
[CommandEightBall]
EightBallYes4=Yes - definitely.
EightBallYes3=Without a doubt.
EightBallYes2=It is decidedly so.
EightBallYes1=It is certain.
EightBallYes8=Outlook good.
EightBallYes7=Most likely.
EightBallYes6=As I see it, yes.
EightBallYes5=You may rely on it.
EightBallMaybe1=Reply hazy, try again.
EightBallMaybe2=Ask again later.
EightBallError=Hmm? You'll need to ask a question!
EightBallMaybe3=Better not tell you now.
EightBallMaybe4=Cannot predict now.
EightBallMaybe5=Concentrate and ask again.
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.
EightBallNo5=Very doubtful.
EightBallNo3=My sources say no.
EightBallNo4=Outlook not so good.
EightBallNo1=Don't count on it.
EightBallNo2=My reply is no.
EightBallYes9=Yes.
EightBallYes10=Signs point to yes.
[CommandInvite]
InviteInfo=Provides a direct invite link for KittyBot
[CommandRaffleJoin]
RaffleJoinFailure=You can't join the raffle ;3;
RaffleJoinInfo=
RaffleJoinSuccess=You joined the raffle!
[CommandDBFlush]
DBFlushInfo=Takes all objects queued for the database and writes them to the database, then says how many were written.
Binary file not shown.
+202
View File
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Binary file not shown.
+202
View File
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Binary file not shown.
+202
View File
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Binary file not shown.
+202
View File
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Binary file not shown.
-37
View File
@@ -1,37 +0,0 @@
package commands;
import core.CharacterManager;
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 CommandCharacterCreate extends Command
{
public CommandCharacterCreate(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String getHelpText() { return LocStrings.stub("CharacterCreateInfo"); }
@Override
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
String [] info = input.args.split(",");
if(info.length < 3)
{
res.send(LocStrings.stub("CharacterCreateNullInfo"));
return;
}
if(CharacterManager.instance.addCharacter(user, info[0], info[1], info[2]))
{
res.send(LocStrings.stub("CharacterCreateSuccess"));
return;
}
res.send(LocStrings.stub("CharacterCreateDuplicate"));
}
}
-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));
}
}
}
@@ -0,0 +1,28 @@
package commands.characters;
import core.CharacterManager;
import core.LocStrings;
import core.SubCommand;
import core.SubCommandFormattable;
import dataStructures.*;
public class CommandCharacterCreate extends SubCommand
{
public CommandCharacterCreate(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
{
String [] info = input.split(",");
if(info.length < 3)
{
return new SubCommandFormattable (LocStrings.stub("CharacterCreateNullInfo"));
}
if(CharacterManager.instance.addCharacter(user, info[0], info[1], info[2]))
{
return new SubCommandFormattable (LocStrings.stub("CharacterCreateSuccess"));
}
return new SubCommandFormattable (LocStrings.stub("CharacterCreateDuplicate"));
}
}
@@ -1,4 +1,4 @@
package commands; package commands.characters;
import core.CharacterManager; import core.CharacterManager;
import core.Command; import core.Command;
@@ -1,4 +1,4 @@
package commands; package commands.characters;
import core.CharacterManager; import core.CharacterManager;
import core.Command; import core.Command;
@@ -1,4 +1,4 @@
package commands; package commands.characters;
import core.CharacterManager; import core.CharacterManager;
import core.Command; import core.Command;
@@ -0,0 +1,33 @@
package commands.characters;
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 CommandCharacterMain extends Command
{
SubCommandFramework framework = new SubCommandFramework();
public CommandCharacterMain(KittyRole level, KittyRating rating)
{
super(level, rating);
}
@Override
public String getHelpText() { return LocStrings.stub("CharacterInfo"); }
@Override
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
framework.run(guild, channel, user, input.args).Call(res);
}
}
@@ -1,4 +1,4 @@
package commands; package commands.characters;
import java.util.ArrayList; import java.util.ArrayList;
@@ -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.*; 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,7 +1,7 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.Config; import core.Constants;
import core.DatabaseManager; import core.DatabaseManager;
import core.LocStrings; import core.LocStrings;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
@@ -28,7 +28,7 @@ public class CommandDBFlush extends Command
KittyEmbed embed = new KittyEmbed(); KittyEmbed embed = new KittyEmbed();
embed.title = "Database queue flushed"; embed.title = "Database queue flushed";
embed.descriptionText = "**Dirty:** " + numUpdated; embed.descriptionText = "**Dirty:** " + numUpdated;
embed.color = Config.ColorDefault; embed.color = Constants.ColorDefault;
res.send(embed); res.send(embed);
} }
@@ -1,10 +1,10 @@
package commands; package commands.general;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import core.Command; import core.Command;
import core.Config; import core.Constants;
import core.DatabaseManager; import core.DatabaseManager;
import core.LocStrings; import core.LocStrings;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
@@ -36,7 +36,7 @@ public class CommandDBStats extends Command
embed.descriptionText = "**Tracked Items:** " + DatabaseManager.instance.getTrackedObjectsSize(); embed.descriptionText = "**Tracked Items:** " + DatabaseManager.instance.getTrackedObjectsSize();
embed.descriptionText += "\n"; embed.descriptionText += "\n";
embed.descriptionText += "**Last Upkeep:** " + dateFormat.format(DatabaseManager.instance.getLastUpkeep()) + " UTC-7"; embed.descriptionText += "**Last Upkeep:** " + dateFormat.format(DatabaseManager.instance.getLastUpkeep()) + " UTC-7";
embed.color = Config.ColorDefault; embed.color = Constants.ColorDefault;
res.send(embed); res.send(embed);
} }
@@ -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,10 +1,10 @@
package commands; package commands.general;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import core.Command; import core.Command;
import core.Config; import core.Constants;
import core.DatabaseManager; import core.DatabaseManager;
import core.LocStrings; import core.LocStrings;
import core.ObjectBuilderFactory; import core.ObjectBuilderFactory;
@@ -79,7 +79,7 @@ public class CommandLeaderboard extends Command
// Configure output // Configure output
final int listSize = 10; final int listSize = 10;
KittyEmbed embed = new KittyEmbed(); KittyEmbed embed = new KittyEmbed();
embed.color = Config.ColorDefault; embed.color = Constants.ColorDefault;
embed.title = LocStrings.stub("LeaderboardTitle"); embed.title = LocStrings.stub("LeaderboardTitle");
embed.descriptionText = ""; embed.descriptionText = "";
@@ -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;
@@ -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.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;
+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.LocStrings; import core.LocStrings;
@@ -1,4 +1,4 @@
package commands; package commands.general;
import java.util.Stack; import java.util.Stack;
@@ -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,9 +1,9 @@
package commands; package commands.general;
import core.Command; import core.Command;
import core.LocStrings; import core.LocStrings;
import core.CommandManager.ThreadData; import core.CommandManager.ThreadData;
import core.Config; import core.Constants;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
import dataStructures.KittyEmbed; import dataStructures.KittyEmbed;
import dataStructures.KittyGuild; import dataStructures.KittyGuild;
@@ -82,7 +82,7 @@ public class CommandStats extends Command
KittyEmbed embed = new KittyEmbed(); KittyEmbed embed = new KittyEmbed();
embed.title = "Bot Stats"; embed.title = "Bot Stats";
embed.descriptionText = out; embed.descriptionText = out;
embed.color = Config.ColorDefault; embed.color = Constants.ColorDefault;
res.send(embed); res.send(embed);
} }
@@ -1,10 +1,10 @@
package commands; package commands.general;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import core.Command; import core.Command;
import core.Config; import core.Constants;
import core.LocStrings; import core.LocStrings;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
import dataStructures.KittyGuild; import dataStructures.KittyGuild;
@@ -54,7 +54,7 @@ public class CommandTeey extends Command
return; return;
teeyeeFile = new File(yeeteeFilename); teeyeeFile = new File(yeeteeFilename);
ImageOverlayBuilder builder = new ImageOverlayBuilder(Config.AssetDirectory + "teey/frames/", "teey ", 24, 18); ImageOverlayBuilder builder = new ImageOverlayBuilder(Constants.AssetDirectory + "teey/frames/", "teey ", 24, 18);
builder.overlay(ImageIO.read(teeyeeFile), name); builder.overlay(ImageIO.read(teeyeeFile), name);
} }
catch (IOException e) catch (IOException e)
@@ -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,10 +1,10 @@
package commands; package commands.general;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import core.Command; import core.Command;
import core.Config; import core.Constants;
import core.LocStrings; import core.LocStrings;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
import dataStructures.KittyGuild; import dataStructures.KittyGuild;
@@ -54,7 +54,7 @@ public class CommandYeet extends Command
return; return;
yeeteeFile = new File(yeeteeFilename); yeeteeFile = new File(yeeteeFilename);
ImageOverlayBuilder builder = new ImageOverlayBuilder(Config.AssetDirectory + "yeet/frames/", "yeet ", 24, 18); ImageOverlayBuilder builder = new ImageOverlayBuilder(Constants.AssetDirectory + "yeet/frames/", "yeet ", 24, 18);
builder.overlay(ImageIO.read(yeeteeFile), name); builder.overlay(ImageIO.read(yeeteeFile), name);
} }
catch (IOException e) catch (IOException e)
@@ -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 SubCommandAdd (KittyRole.General, KittyRating.Safe));
framework.addCommand("remove", new SubCommandRemove(KittyRole.General, KittyRating.Safe));
framework.addCommand("allowed", new SubCommandAllowed(KittyRole.Admin, KittyRating.Safe));
framework.addCommand("unallowed", new SubCommandNotAllowed(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);
}
}
+36
View File
@@ -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 SubCommandAdd extends SubCommand
{
public SubCommandAdd(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 SubCommandAllowed extends SubCommand
{
public SubCommandAllowed(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 SubCommandList extends SubCommand
{
public SubCommandList(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,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 SubCommandNotAllowed extends SubCommand
{
public SubCommandNotAllowed(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 SubCommandRemove extends SubCommand
{
public SubCommandRemove(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);
}
}
-90
View File
@@ -1,90 +0,0 @@
package core;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;
import java.util.ListIterator;
import java.util.function.Consumer;
import dataStructures.Pair;
import utils.GlobalLog;
import utils.LogFilter;
import utils.io.FileUtils;
public class BaseKeyValueFile
{
// Variables
public static final String headerStart = "[";
public static final String headerEnd = "]";
public static final String pairSplit = "=";
public static final char pairSeparator = '\n';
protected final String filename;
protected final String header;
// Constructor
public BaseKeyValueFile(String filename)
{
this.filename = filename;
this.header = headerStart + this.getClass().getSimpleName() + headerEnd;
}
// Reads in and calls the specifid function for each keyvalue pair we find
protected void parse(Consumer<? super Pair<String, String>> keyValueCallback)
{
File f = new File(filename);
if(f.isFile() && f.canRead())
{
String content = FileUtils.readContent(f).trim();
String[] lines = content.split("" + pairSeparator);
for(int i = 0; i < lines.length; ++i)
{
if(lines[i].contains(header))
continue;
String[] pair = lines[i].split(pairSplit);
if(pair.length < 2)
continue;
String key = pair[0].trim().toLowerCase();
String value = pair[1].trim().toLowerCase();
keyValueCallback.accept(new Pair<String, String>(key, value));
}
}
}
// Writes out a set of keyvalue pairs
protected void write(List<Pair<String, String>> toWrite)
{
try
{
ListIterator<Pair<String, String>> iter = toWrite.listIterator();
String outString = "";
outString += header + pairSeparator;
while(iter.hasNext())
{
Pair<String, String> pair = iter.next();
String key = pair.First.toLowerCase();
String value = pair.Second.toLowerCase();
outString += key + pairSplit + value + pairSeparator;
}
BufferedWriter writer = new BufferedWriter(new FileWriter(filename));
writer.write(outString);
writer.close();
}
catch (IOException e)
{
GlobalLog.error(LogFilter.Core, "Issue writing file " + filename + ": " + e.getMessage());
}
}
}
+105 -115
View File
@@ -1,67 +1,66 @@
package core; package core;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList; import java.util.ArrayList;
import dataStructures.TaggedPairStore; import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Vector;
import utils.GlobalLog; import utils.GlobalLog;
import utils.LogFilter; import utils.LogFilter;
import utils.io.FileMonitor;
import utils.io.FileUtils; import utils.io.FileUtils;
import utils.io.MonitoredFile;
// A quick-and-dirty localization tool that scrapes the project for calls to itself, then // A quick-and-dirty localization tool that scrapes the project for calls to itself, then
// generates/updates a file externally with all the stub values as keys that are localized. // generates/updates a file externally with all the stub values as keys that are localized.
public abstract class BaseLocFile public abstract class BaseLocFile implements IConfigSection
{ {
// Pre-defined values // Variables
public static final String KittySourceDirectory = "./src"; protected final String headerName; // Example: Loc Strings
protected final String functionName; // Example: "Localizer.Stub";
// Filename protected Map<String, String> localized;
public final String filename; // Example: "localization.config";
public final String functionName; // Example: "Localizer.Stub";
// Local translation storage
protected TaggedPairStore stringStore;
// Logging // Logging
private void log(String str) { GlobalLog.log(LogFilter.Strings, str); } private void log(String str) { GlobalLog.log(LogFilter.Strings, str); }
private void warn(String str) { GlobalLog.warn(LogFilter.Strings, str); } private void warn(String str) { GlobalLog.warn(LogFilter.Strings, str); }
private void error(String str) { GlobalLog.error(LogFilter.Strings, str); } private void error(String str) { GlobalLog.error(LogFilter.Strings, str); }
// File monitoring
protected FileMonitor fileMonitor;
// Constructor // Constructor
public BaseLocFile(String filename, String functionName) public BaseLocFile(String headerName, String functionName)
{ {
this.filename = filename; this.headerName = headerName;
this.functionName = functionName; this.functionName = functionName;
localized = new HashMap<String, String>();
} }
//////////////////////////////////////////////////
// First Step: Populating with existing strings //
//////////////////////////////////////////////////
// Checks the file specified for updates private void buildLocalized(List<ConfigItem> pairs)
public void update()
{ {
synchronized(stringStore) for(ConfigItem item : pairs)
{ {
fileMonitor.update(this::onFileChange); if(item.value.trim().length() <= 0)
{
localized.put(item.key, item.key);
}
else
{
localized.put(item.key, item.value);
}
} }
} }
// When the file is changed //////////////////////////////////////////
protected void onFileChange(MonitoredFile file) // Second Step: Scraping existing files //
{ //////////////////////////////////////////
log("Loc file was modified at path " + file.path);
updateLocFromDisk();
}
// Structure used for holding a pair of strings and any other info we need // Structure used for holding a pair of strings and any other info we need
// about localized information that is being looked up. // about localized information that is being looked up.
@SuppressWarnings("unused")
private class LocInfo private class LocInfo
{ {
public String file; public String file;
@@ -74,8 +73,21 @@ public abstract class BaseLocFile
} }
} }
// Try to perform stripping java files for contents to localize
private void tryStripSpecified(Path path, ArrayList<LocInfo> toFill)
{
try
{
stripForContents(path, toFill);
}
catch(Exception e)
{
error("issue with file: " + path.toString());
}
}
// Do processing on each path in the scraped directory here, assuming it's .java // Do processing on each path in the scraped directory here, assuming it's .java
public void stripForContents(Path path, ArrayList<LocInfo> strings) private void stripForContents(Path path, ArrayList<LocInfo> strings)
{ {
String filename = path.getFileName().toString(); String filename = path.getFileName().toString();
if(filename.contains(".java")) if(filename.contains(".java"))
@@ -93,8 +105,8 @@ public abstract class BaseLocFile
{ {
if(noWhitespace.charAt(noWhitespace.indexOf(")") - 1) == '"' && split[i].charAt(loc - 2) != '\\') if(noWhitespace.charAt(noWhitespace.indexOf(")") - 1) == '"' && split[i].charAt(loc - 2) != '\\')
{ {
// At this point, we find the first ), then verify there's a ") behind it, and that // At this point we find the first ), then verify there's a ") behind it,
// the " is not an escaped character. // and that the " is not an escaped character.
try try
{ {
String toLocalize = split[i].substring(2, loc - 1); String toLocalize = split[i].substring(2, loc - 1);
@@ -113,99 +125,77 @@ public abstract class BaseLocFile
} }
} }
// Nothing for now, but in the future will return a parsed and localized version of // Returns the localized string if available.
// the string in question if one can be found. If the localized string is empty, // If the localized string is empty, returns a the key instead as the default phrase.
// returns a the key instead which is the default phrase.
public String getKey(String input) public String getKey(String input)
{ {
if(stringStore == null) if(localized == null)
{
return input; return input;
}
String value = stringStore.getKey(input); String value = localized.get(input);
if(value == null || value.trim().length() < 1) if(value == null || value.trim().length() < 1)
{
return input; return input;
}
return value; return value;
} }
// Reads a file to string, adapted from https://stackoverflow.com/a/326440/5383198
private String readFileAsString(String path, Charset encoding)
{
try
{
byte[] encoded = Files.readAllBytes(Paths.get(path));
return new String(encoded, encoding);
}
catch (IOException e)
{
warn("No file found to read from!");
}
return null;
}
// Update localization from the disk on file. Creates the file if it doesn't exist.
// This file is internally formatted as an ini file.
public void updateLocFromDisk()
{
log("Attempting to read localization file: " + filename);
try
{
String fileContents = readFileAsString(filename, Charset.defaultCharset());
if(fileContents == null)
{
File file = new File(filename);
file.createNewFile();
}
stringStore = new TaggedPairStore(fileContents);
}
catch(IOException e)
{
error("IO exception during localization file read");
}
}
// Rewrites out at the specified filename with existing stubs.
// This preserves existing localized phrases.
public void saveLocToDisk()
{
log("Attempting to write updated localization file");
try
{
PrintWriter pw = new PrintWriter(filename);
pw.println(stringStore.toString());
pw.close();
}
catch(IOException e)
{
error("IO exception during localization file write");
}
}
private void tryStripSpecified(Path path, ArrayList<LocInfo> toFill)
{
try
{
stripForContents(path, toFill);
}
catch(Exception e)
{
error("issue with file: " + path.toString());
}
}
// Scrape the project and generate all the possible localizeable phrases. // Scrape the project and generate all the possible localizeable phrases.
// This stubs out phrases to be localized. // This stubs out phrases to be localized, by default placing the key in as the value.
public void scrapeAll() public void scrapeAll()
{ {
ArrayList<LocInfo> localizeList = new ArrayList<LocInfo>(); ArrayList<LocInfo> localizeList = new ArrayList<LocInfo>();
FileUtils.acquireAllFiles(KittySourceDirectory).forEach((path) -> tryStripSpecified(path, localizeList)); FileUtils.acquireAllFiles(Constants.SourceDirectory).forEach((path) -> tryStripSpecified(path, localizeList));
for(LocInfo toStub : localizeList) for(LocInfo toStub : localizeList)
stringStore.addKeyValue(toStub.file, toStub.phrase, toStub.phrase); {
localized.putIfAbsent(toStub.phrase, toStub.phrase);
}
}
///////////////////////////////////
// IConfigSection Implementation //
///////////////////////////////////
@Override
public String getSectionTitle()
{
return headerName;
}
@Override
public void consume(List<ConfigItem> pairs)
{
localized.clear();
buildLocalized(pairs);
scrapeAll();
}
@Override
public List<ConfigItem> produce()
{
List<ConfigItem> items = new Vector<ConfigItem>();
for(Entry<String, String> keyValuePair : localized.entrySet())
{
String key = keyValuePair.getKey();
String value = keyValuePair.getValue();
if(key.equalsIgnoreCase(value))
{
items.add(new ConfigItem(headerName, key, ""));
}
else
{
items.add(new ConfigItem(headerName, key, value));
}
}
items.sort((item1, item2) -> item1.key.compareToIgnoreCase(item2.key));
return items;
} }
} }
+82 -29
View File
@@ -5,7 +5,6 @@ import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Vector; import java.util.Vector;
import dataStructures.Pair;
import utils.GlobalLog; import utils.GlobalLog;
import utils.LogFilter; import utils.LogFilter;
@@ -13,48 +12,75 @@ import utils.LogFilter;
// commands that are being looked up will behave slightly differently so trimming // commands that are being looked up will behave slightly differently so trimming
// rules for this file are different than the localization ones - this is more // rules for this file are different than the localization ones - this is more
// aggresive with whitespace removal. // aggresive with whitespace removal.
public class CommandEnabler extends BaseKeyValueFile public class CommandEnabler implements IConfigSection
{ {
// Config/const variables // Config/const variables
public static final String enabled = "1"; public static final String enabled = "1";
public static final String disabled = "0"; public static final String disabled = "0";
public static final boolean defaultEnabledState = true; public static final boolean defaultEnabledState = true;
public static final String commandSplit = ",";
public static final String HeaderName = "Command Enabler";
// Local variables // Local variables
private HashMap<String, Boolean> enabledMap; // Quick lookup private HashMap<String, Boolean> enabledMap; // Quick lookup
private ArrayList<String> keyList; // Tracking ordering for later private HashMap<String, String> likeNames; // Single names mapped to multiple names for use in enabledMap.
private final static String name = Config.AssetDirectory + "commands.config"; private ArrayList<String> keyList; // Tracking ordering for later
// Instance
public static CommandEnabler instance;
// Constructor // Constructor
public CommandEnabler() public CommandEnabler()
{ {
super(name); super();
// Create/Init variables if(instance == null)
GlobalLog.log(LogFilter.Core, "Initializing " + this.getClass().getSimpleName()); {
enabledMap = new HashMap<>(); // Create/Init variables
keyList = new ArrayList<>(); GlobalLog.log(LogFilter.Core, "Initializing " + this.getClass().getSimpleName());
enabledMap = new HashMap<>();
// Startup keyList = new ArrayList<>();
readIn(); likeNames = new HashMap<String, String>();
getTrackedCommands();
writeOut(); instance = this;
}
else
{
GlobalLog.error(LogFilter.Core, "You can't have two of the following: " + this.getClass().getSimpleName());
}
} }
// Reads in the config file and parses it, keeping tabs on the order it read things // Reads in the config file and parses it, keeping tabs on the order it read things
private void readIn() private void readIn(List<ConfigItem> items)
{ {
parse((pair) ->{ keyList.clear();
String key = pair.First; enabledMap.clear();
String value = pair.Second;
for(ConfigItem item : items)
{
String key = item.key;
String value = item.value;
// Keep track of the key itself
keyList.add(key); keyList.add(key);
// Write if it's enabled or disabled.
if(value.equalsIgnoreCase(enabled)) if(value.equalsIgnoreCase(enabled))
{
enabledMap.putIfAbsent(key, true); enabledMap.putIfAbsent(key, true);
}
else else
{
enabledMap.putIfAbsent(key, false); enabledMap.putIfAbsent(key, false);
}); }
// Keep track of alternate names
String[] keys = key.split(commandSplit);
for(int i = 0; i < keys.length; ++i)
{
likeNames.putIfAbsent(keys[i], key);
}
}
} }
// Look up the already scraped values from the localizer and store them if they // Look up the already scraped values from the localizer and store them if they
@@ -76,9 +102,10 @@ public class CommandEnabler extends BaseKeyValueFile
} }
// Write out enabled/disabled file info. // Write out enabled/disabled file info.
private void writeOut() private List<ConfigItem> writeOut()
{ {
List<Pair<String, String>> list = new Vector<Pair<String, String>>(); // Parse in original format
List<ConfigItem> configItems = new Vector<ConfigItem>();
for(int i = 0; i < keyList.size(); ++i) for(int i = 0; i < keyList.size(); ++i)
{ {
@@ -86,14 +113,16 @@ public class CommandEnabler extends BaseKeyValueFile
String value = enabled.toLowerCase(); String value = enabled.toLowerCase();
if(enabledMap.get(key) == false) if(enabledMap.get(key) == false)
{
value = disabled.toLowerCase(); value = disabled.toLowerCase();
}
list.add(new Pair<String, String>(key, value)); configItems.add(new ConfigItem(HeaderName, key, value));
} }
Collections.sort(list, (c1, c2) -> { return c1.First.compareTo(c2.First); }); Collections.sort(configItems, (c1, c2) -> { return c1.key.compareTo(c2.key); });
write(list); return configItems;
} }
// Looks up a key to see if it's enabled or not // Looks up a key to see if it's enabled or not
@@ -101,9 +130,33 @@ public class CommandEnabler extends BaseKeyValueFile
{ {
String toCheck = key.toLowerCase(); String toCheck = key.toLowerCase();
if(enabledMap.containsKey(toCheck)) // Look up to see if we have the key anywhere. If not, default to enabled.
return enabledMap.get(toCheck); // It should be noted that this is just checking for disabled commands, we don't
// determine if a key is actually a real command in here or not.
String fullKey = likeNames.getOrDefault(toCheck, null);
if(fullKey == null)
return true;
return true; // If we have it, look it up. If we can't find it, default to true.
return enabledMap.getOrDefault(fullKey, true);
}
@Override
public String getSectionTitle()
{
return HeaderName;
}
@Override
public void consume(List<ConfigItem> pairs)
{
readIn(pairs);
getTrackedCommands();
}
@Override
public List<ConfigItem> produce()
{
return writeOut();
} }
} }
+118 -38
View File
@@ -3,8 +3,16 @@ package core;
import java.util.*; import java.util.*;
import java.util.Map.Entry; import java.util.Map.Entry;
import commands.characters.CommandCharacterEditBio;
import commands.characters.CommandCharacterEditName;
import commands.characters.CommandCharacterEditURL;
import commands.characters.CommandCharacterSearch;
import commands.general.*;
import commands.guildrole.CommandGuildRoleMain;
import dataStructures.KittyChannel; import dataStructures.KittyChannel;
import dataStructures.KittyGuild; import dataStructures.KittyGuild;
import dataStructures.KittyRating;
import dataStructures.KittyRole;
import dataStructures.KittyUser; import dataStructures.KittyUser;
import dataStructures.Pair; import dataStructures.Pair;
import dataStructures.Response; import dataStructures.Response;
@@ -20,13 +28,97 @@ public class CommandManager
private CommandEnabler commandEnabler; private CommandEnabler commandEnabler;
private long invokeCount; private long invokeCount;
// Singleton
public static CommandManager instance;
// Default Constructor // Default Constructor
public CommandManager(CommandEnabler commandEnabler) public CommandManager(CommandEnabler commandEnabler)
{ {
this.commands = new HashMap<String, Command>(); GlobalLog.log(LogFilter.Core, "Initializing " + this.getClass().getSimpleName());
this.threadAccumulator = new ArrayList<CommandThread>();
this.invokeCount = 0; if(instance == null)
this.commandEnabler = commandEnabler; {
this.commands = new HashMap<String, Command>();
this.threadAccumulator = new ArrayList<CommandThread>();
this.invokeCount = 0;
this.commandEnabler = commandEnabler;
registerAllCommands();
instance = this;
}
else
{
GlobalLog.error(LogFilter.Core, "You can't have two of the following: " + this.getClass().getSimpleName());
}
}
// Registers all the commands for the instance
public void registerAllCommands()
{
this.commands.clear();
// Dev
this.register(LocCommands.stub("work"), new CommandDoWork(KittyRole.Dev, KittyRating.Safe));
this.register(LocCommands.stub("shutdown"), new CommandShutdown(KittyRole.Dev, KittyRating.Safe));
this.register(LocCommands.stub("stats"), new CommandStats(KittyRole.Dev, KittyRating.Safe));
this.register(LocCommands.stub("invite"), new CommandInvite(KittyRole.Dev, KittyRating.Safe));
this.register(LocCommands.stub("buildHelp"), new CommandHelpBuilder(KittyRole.Dev, KittyRating.Safe));
this.register(LocCommands.stub("tweet"), new CommandTweet(KittyRole.Dev, KittyRating.Safe));
this.register(LocCommands.stub("dbflush"), new CommandDBFlush(KittyRole.Dev, KittyRating.Safe));
this.register(LocCommands.stub("dbstats"), new CommandDBStats(KittyRole.Dev, KittyRating.Safe));
// Admin
this.register(LocCommands.stub("rating"), new CommandRating(KittyRole.Admin, KittyRating.Safe));
this.register(LocCommands.stub("indicator"), new CommandChangeIndicator(KittyRole.Admin, KittyRating.Safe));
// Mod
this.register(LocCommands.stub("poll"), new CommandPollManage(KittyRole.Mod, KittyRating.Safe));
this.register(LocCommands.stub("givebeans"), new CommandGiveBeans(KittyRole.Mod, KittyRating.Safe));
this.register(LocCommands.stub("rpg"), new CommandRPG(KittyRole.Mod, KittyRating.Safe));
this.register(LocCommands.stub("rafflestart"), new CommandRaffleStart(KittyRole.Mod, KittyRating.Safe));
this.register(LocCommands.stub("rafflespin"), new CommandRaffleSpin(KittyRole.Mod, KittyRating.Safe));
this.register(LocCommands.stub("raffleend"), new CommandRaffleEnd(KittyRole.Mod, KittyRating.Safe));
// General
this.register(LocCommands.stub("fetch"), new CommandFetch(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("teey"), new CommandTeey(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("perish, thenperish"), new CommandPerish(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("yeet"), new CommandYeet(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("ping"), new CommandPing(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("boop"), new CommandBoop(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("roll"), new CommandRoll(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("choose"), new CommandChoose(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("help"), new CommandHelp(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("info, about"), new CommandInfo(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("vote"), new CommandPollVote(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("results"), new CommandPollResults(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("showpoll"), new CommandPollShow(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("wolfram"), new CommandWolfram(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("c++, g++, cplus, cpp"), new CommandColiru(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("java, jdoodle"), new CommandJDoodle(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("beans"), new CommandBeansShow(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("kittyrole"), new CommandRole(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("bet"), new CommandBetBeans(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("map"), new CommandMap(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("rpstart"), new CommandRPStart(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("rpend"), new CommandRPEnd(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("tony, stark, dontfeelgood, dontfeelsogood"), new CommandStark(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("blur"), new CommandBlurry(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("eightball, 8ball"), new CommandEightBall(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("catch"), new CommandCatch(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("bethistory"), new CommandBetHistory(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("crouton"), new CommandCrouton(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("benchmark, bench"), new CommandBenchmark(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("rafflejoin"), new CommandRaffleJoin(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("searchcharacter"), new CommandCharacterSearch(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("charactereditbio"), new CommandCharacterEditBio(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("charactereditname"), new CommandCharacterEditName(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("charactereditURL"), new CommandCharacterEditURL(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("leaderboard"), new CommandLeaderboard(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("color, colour"), new CommandColor(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("remind"), new CommandRemind(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("role"), new CommandGuildRoleMain(KittyRole.General, KittyRating.Safe));
} }
// Allows the command manager to keep track of a command. Takes a pair (the un-localized and localzied commands) // Allows the command manager to keep track of a command. Takes a pair (the un-localized and localzied commands)
@@ -36,41 +128,23 @@ public class CommandManager
if(pair == null || pair.Second == null) if(pair == null || pair.Second == null)
return; return;
// If we haven't already split a multisplit command (or even assessed that), String[] keys = pair.Second.split(",");
// then verify if we even need to register the commands at all. If it's
// not enabled, don't register it.
if(pair.First != null && !commandEnabler.isEnabled(pair.First))
return;
String key = pair.Second;
if(key.contains(","))
{
String[] keys = key.split(",");
register(keys, command);
return;
}
key = key.toLowerCase();
command.registeredNames.add(key);
Command old = commands.put(key, command);
if(old != null)
{
GlobalLog.warn(LogFilter.Core, "Writing over a command with the key " + key);
return;
}
GlobalLog.log(LogFilter.Core, "Command registered under key " + key);
}
// Registers a command under multiple names!
public void register(String[] keys, Command command)
{
for(int i = 0; i < keys.length; ++i) for(int i = 0; i < keys.length; ++i)
register(new Pair<String, String>(null, keys[i].trim()), command); {
String key = keys[i].trim().toLowerCase();
command.registeredNames.add(key);
Command old = commands.put(key, command);
if(old != null)
{
GlobalLog.warn(LogFilter.Core, "Writing over a command with the key " + key);
return;
}
GlobalLog.log(LogFilter.Core, "Command registered under key " + key);
}
} }
// Calls the command but on a whole new thread! // Calls the command but on a whole new thread!
@@ -80,6 +154,12 @@ public class CommandManager
if(input == null || !input.isValid()) if(input == null || !input.isValid())
return false; return false;
// At this point, verify that the command is enabled. If we don't have any info
// on if it's enabled or not, we assume it's enabled to prevent broken functionality due
// to formatting or casing issues.
if(input.key != null && !commandEnabler.isEnabled(input.key))
return false;
Command command = commands.get(input.key); Command command = commands.get(input.key);
if(command != null) if(command != null)
{ {
+72 -5
View File
@@ -1,9 +1,76 @@
package core; package core;
import java.awt.Color; import java.util.List;
import java.util.Map;
import java.util.Vector;
public final class Config import utils.GlobalLog;
{ import utils.io.FileMonitor;
public static final Color ColorDefault = new Color(7*16, 8*16, 9*16); // A slate-grey
public static final String AssetDirectory = "./assets/"; public class Config
{
private static final String filepath = Constants.AssetDirectory + Constants.ConfigFilename;
private ConfigCSV configCSV;
private List<IConfigSection> sections;
private FileMonitor monitoredConfigFile;
public static Config instance;
public Config()
{
if(instance == null)
{
sections = new Vector<IConfigSection>();
// Add all sections
sections.add(new LocCommands());
sections.add(new LocStrings());
sections.add(new CommandEnabler());
// Build the config file, then start monitoring it.
buildConfigFile(filepath);
monitoredConfigFile = new FileMonitor(filepath);
instance = this;
}
else
{
System.out.println("Only one config class is allowed, period. Aborting.");
System.out.flush();
System.exit(-1);
}
}
public void buildConfigFile(String path)
{
configCSV = new ConfigCSV(sections, path);
Map<String, List<ConfigItem>> groupedSections = ConfigCSV.groupByColumn(configCSV.getItems(), 0);
if(groupedSections != null)
{
for(IConfigSection section : sections)
{
List<ConfigItem> items = groupedSections.getOrDefault(section.getSectionTitle(), new Vector<ConfigItem>());
section.consume(items);
}
}
configCSV.writeFile();
}
public void upkeep()
{
monitoredConfigFile.update((monitoredFile) ->
{
GlobalLog.log("File updated at " + monitoredFile.path);
buildConfigFile(monitoredFile.path.toString());
// Re-register all commands now that we've updated the config.
// Before we do that tho, sync off anything that needs syncing.
// TODO: This is not thread safe.
DatabaseManager.instance.upkeep();
CommandManager.instance.registerAllCommands();
});
}
} }
+166
View File
@@ -0,0 +1,166 @@
package core;
import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import com.opencsv.CSVReader;
import com.opencsv.CSVReaderBuilder;
import com.opencsv.CSVWriter;
import utils.GlobalLog;
public class ConfigCSV
{
// Variables
private final String path;
private List<ConfigItem> fileContents;
private List<IConfigSection> sections;
// Constructor
public ConfigCSV(List<IConfigSection> sections, String path)
{
this.path = path;
this.sections = sections;
fileContents = new Vector<ConfigItem>();
read(path);
}
// Creates the writer in the format we desire.
public static CSVWriter makeWriter(Writer writer)
{
return new CSVWriter(writer,
CSVWriter.DEFAULT_SEPARATOR,
CSVWriter.DEFAULT_QUOTE_CHARACTER,
'\\',
CSVWriter.DEFAULT_LINE_END);
}
// Read the file. This is internal only.
private void read(String filepath)
{
try
{
File configFile = new File(filepath);
// If we had to create a new file, write the default header into it.
if(configFile.createNewFile())
{
Writer writer = Files.newBufferedWriter(Paths.get(path));
CSVWriter csvWriter = makeWriter(writer);
csvWriter.writeNext(ConfigItem.header);
csvWriter.close();
}
Reader reader = Files.newBufferedReader(Paths.get(filepath));
CSVReader csvReader = new CSVReaderBuilder(reader).withSkipLines(1).build();
fileContents.clear();
// Read contents. As for the line number, we not only start counting at 1, we also skip the header.
int line = 2;
String[] record = null;
while ((record = csvReader.readNext()) != null)
{
if(record.length < ConfigItem.items)
{
GlobalLog.warn("Incorrect number of items on line " + line + " in " + path);
continue;
}
ConfigItem parsedLine = new ConfigItem(record[0], record[1], record[2]);
fileContents.add(parsedLine);
++line;
}
// Close down
csvReader.close();
reader.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
// Get a copy of the internal items
public List<ConfigItem> getItems()
{
List<ConfigItem> out = new Vector<ConfigItem>();
for(ConfigItem item : fileContents)
{
out.add(new ConfigItem(item.type, item.key, item.value));
}
return out;
}
// Set the internal items
public void setItems(List<ConfigItem> newList)
{
fileContents = newList;
}
// Write out the file, header then body.
public void writeFile()
{
try
{
List<String[]> toWrite = new Vector<String[]>();
toWrite.add(ConfigItem.header);
for(IConfigSection section : sections)
{
List<ConfigItem> items = section.produce();
for(ConfigItem item : items)
{
toWrite.add(item.getAll());
}
}
Writer writer = Files.newBufferedWriter(Paths.get(path));
CSVWriter csvWriter = makeWriter(writer);
csvWriter.writeAll(toWrite);
csvWriter.flush();
csvWriter.close();
writer.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
// Static utility function
public static Map<String, List<ConfigItem>> groupByColumn(List<ConfigItem> items, int columnNumber)
{
if(items == null || items.size() <= 0 || columnNumber < 0)
{
return null;
}
Map<String, List<ConfigItem>> sortedItems = new HashMap<String, List<ConfigItem>>();
for(ConfigItem item : items)
{
String key = item.getColumn(columnNumber);
List<ConfigItem> list = sortedItems.getOrDefault(key, new Vector<ConfigItem>());
list.add(item);
sortedItems.put(key, list);
}
return sortedItems;
}
}
+40
View File
@@ -0,0 +1,40 @@
package core;
// Everything in here must be a string type. This class does not
// perform any parsing past naming columns, and just holds the raw data.
public class ConfigItem
{
public String type;
public String key;
public String value;
public static final int items = 3;
public static final String[] header = {"Type","Key","Value"};
public ConfigItem(String type, String key, String value)
{
this.type = type;
this.key = key;
this.value = value;
}
public String getColumn(int column)
{
switch(column)
{
case 0: return type;
case 1: return key;
case 2: return value;
default: return null;
}
}
public String[] getAll()
{
return new String[] {type, key, value};
}
public String toString()
{
return "type: " + type + ", key: " + key + ", value: " + value;
}
}
+12
View File
@@ -0,0 +1,12 @@
package core;
import java.awt.Color;
// Things that are internal only and aren't put inside an external config file.
public final class Constants
{
public static final Color ColorDefault = new Color(7*16, 8*16, 9*16); // A slate-grey
public static final String AssetDirectory = "./assets/";
public static final String ConfigFilename = "config.csv";
public static final String SourceDirectory = "./src";
}
+16
View File
@@ -0,0 +1,16 @@
package core;
import java.util.List;
// A config section is a unit of config that holds data.
public abstract interface IConfigSection
{
// Get the title of the section
public abstract String getSectionTitle();
// Provide the parsed key and values for a given section
public abstract void consume(List<ConfigItem> pairs);
// Ask the section to produce a list of pairs to be written out to the key and value columns in the csv
public abstract List<ConfigItem> produce();
}
+8 -16
View File
@@ -1,35 +1,32 @@
package core; package core;
import java.util.ArrayList; import java.util.ArrayList;
import utils.GlobalLog; import utils.GlobalLog;
import utils.LogFilter; import utils.LogFilter;
import utils.io.FileMonitor;
import dataStructures.Pair; import dataStructures.Pair;
// Performs the same localization for the strings associated with command names as // Performs the same localization for the strings associated with command names as
// is performed with general strings in the application // is performed with general strings in the application
public class LocCommands extends BaseLocFile public class LocCommands extends BaseLocFile implements IConfigSection
{ {
public static final String fileName = Config.AssetDirectory + "locCommands.config"; // Defined const variables
public static final String HeaderName = "Localized Commands";
public static final String function = "LocCommands.stub"; public static final String function = "LocCommands.stub";
// Instance
private static LocCommands instance; private static LocCommands instance;
// Constructor
public LocCommands() public LocCommands()
{ {
super(fileName, function); super(HeaderName, function);
GlobalLog.log(LogFilter.Core, "Initializing " + this.getClass().getSimpleName()); GlobalLog.log(LogFilter.Core, "Initializing " + this.getClass().getSimpleName());
if(instance == null) if(instance == null)
{ {
instance = this; instance = this;
updateLocFromDisk();
scrapeAll();
saveLocToDisk();
fileMonitor = new FileMonitor(filename);
} }
else else
{ {
@@ -47,12 +44,7 @@ public class LocCommands extends BaseLocFile
public static ArrayList<String> getUnlocalizedCommands() public static ArrayList<String> getUnlocalizedCommands()
{ {
ArrayList<String> raw = new ArrayList<>(); ArrayList<String> raw = new ArrayList<>();
instance.stringStore.forEach((pair) -> raw.add((String)((Pair<?, ?>)pair).First )); instance.localized.keySet().forEach((key) -> raw.add(key));
return raw; return raw;
} }
public static void upkeep()
{
instance.update();
}
} }
+2 -14
View File
@@ -2,33 +2,26 @@ package core;
import utils.GlobalLog; import utils.GlobalLog;
import utils.LogFilter; import utils.LogFilter;
import utils.io.FileMonitor;
// A quick-and-dirty localization tool that scrapes the project for calls to itself, then // A quick-and-dirty localization tool that scrapes the project for calls to itself, then
// generates/updates a file externally (phrases.config) with all the stub values as keys that // generates/updates a file externally (phrases.config) with all the stub values as keys that
// can then be localized. // can then be localized.
public class LocStrings extends BaseLocFile public class LocStrings extends BaseLocFile
{ {
public static final String fileName = Config.AssetDirectory + "locStrings.config"; public static final String HeaderName = "Localized Strings";
public static final String function = "LocStrings.stub"; public static final String function = "LocStrings.stub";
private static LocStrings instance; private static LocStrings instance;
public LocStrings() public LocStrings()
{ {
super(fileName, function); super(HeaderName, function);
GlobalLog.log(LogFilter.Core, "Initializing " + this.getClass().getSimpleName()); GlobalLog.log(LogFilter.Core, "Initializing " + this.getClass().getSimpleName());
if(instance == null) if(instance == null)
{ {
instance = this; instance = this;
updateLocFromDisk();
scrapeAll();
saveLocToDisk();
fileMonitor = new FileMonitor(filename);
} }
else else
{ {
@@ -46,9 +39,4 @@ public class LocStrings extends BaseLocFile
{ {
return instance.getKey(stubbedPreviously); return instance.getKey(stubbedPreviously);
} }
public static void upkeep()
{
instance.update();
}
} }
+15 -91
View File
@@ -7,18 +7,16 @@ import java.util.concurrent.Semaphore;
import javax.security.auth.login.LoginException; import javax.security.auth.login.LoginException;
import commands.*; import commands.characters.*;
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;
import net.dv8tion.jda.core.AccountType; import net.dv8tion.jda.core.AccountType;
import net.dv8tion.jda.core.JDA; import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.JDABuilder; import net.dv8tion.jda.core.JDABuilder;
import net.dv8tion.jda.core.entities.Emote; import net.dv8tion.jda.core.entities.*;
import net.dv8tion.jda.core.entities.Game;
import net.dv8tion.jda.core.entities.Guild;
import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.User;
import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent; import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent;
import offline.Ref; import offline.Ref;
import utils.AdminControl; import utils.AdminControl;
@@ -51,14 +49,17 @@ public class ObjectBuilderFactory
// Plugin manager // Plugin manager
private static PluginManager pluginManager; private static PluginManager pluginManager;
// Command manager
private static CommandManager commandManager;
// Localization classes - these are singletons, but should be initialized before almost all other // Localization classes - these are singletons, but should be initialized before almost all other
// things so their inclusion in the factory is to ensure they're started at the correct time. // things so their inclusion in the factory is to ensure they're started at the correct time.
@SuppressWarnings("unused") private static LocStrings locStrings; @SuppressWarnings("unused") private static LocStrings locStrings;
@SuppressWarnings("unused") private static LocCommands locCommands; @SuppressWarnings("unused") private static LocCommands locCommands;
// Handles if we can or can't use specific commands, parsing a config file based on loc data to do so. // Config
private static CommandEnabler commandEnabler; @SuppressWarnings("unused") private static Config config;
// Lazy initialization multithreaded mutex stuff to prevent explosions. // Lazy initialization multithreaded mutex stuff to prevent explosions.
// TODO: Investigate using 'synchronized' instead potentially // TODO: Investigate using 'synchronized' instead potentially
@@ -88,8 +89,7 @@ public class ObjectBuilderFactory
// Start by reading from things that are external. Because // Start by reading from things that are external. Because
// we require these things to be resolved before the rest of the application, // we require these things to be resolved before the rest of the application,
// we place them here. // we place them here.
locStrings = new LocStrings(); config = new Config();
locCommands = new LocCommands();
} }
finally finally
{ {
@@ -371,86 +371,10 @@ public class ObjectBuilderFactory
{ {
lazyInit(); lazyInit();
CommandManager manager = new CommandManager(commandEnabler); if(commandManager == null)
commandManager = new CommandManager(commandEnabler);
// Dev return commandManager;
manager.register(LocCommands.stub("work"), new CommandDoWork(KittyRole.Dev, KittyRating.Safe));
manager.register(LocCommands.stub("shutdown"), new CommandShutdown(KittyRole.Dev, KittyRating.Safe));
manager.register(LocCommands.stub("stats"), new CommandStats(KittyRole.Dev, KittyRating.Safe));
manager.register(LocCommands.stub("invite"), new CommandInvite(KittyRole.Dev, KittyRating.Safe));
manager.register(LocCommands.stub("buildHelp"), new CommandHelpBuilder(KittyRole.Dev, KittyRating.Safe));
manager.register(LocCommands.stub("tweet"), new CommandTweet(KittyRole.Dev, KittyRating.Safe));
manager.register(LocCommands.stub("dbflush"), new CommandDBFlush(KittyRole.Dev, KittyRating.Safe));
manager.register(LocCommands.stub("dbstats"), new CommandDBStats(KittyRole.Dev, KittyRating.Safe));
// Admin
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("guildroleallowed"), new CommandGuildRoleAllowed(KittyRole.Admin, KittyRating.Safe));
manager.register(LocCommands.stub("guildrolenotallowed"), new CommandGuildRoleNotAllowed(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("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("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("role"), 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("guildrolelist"), new CommandGuildRoleList(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));
return manager;
}
// Constructs a CommandEnabler if it doesn't exist, and gets the existing one if it does.
public static CommandEnabler constructCommandEnabler()
{
lazyInit();
if(commandEnabler == null)
commandEnabler = new CommandEnabler();
return commandEnabler;
} }
// Default database manager construction. It can be constructed // Default database manager construction. It can be constructed
@@ -492,7 +416,7 @@ public class ObjectBuilderFactory
lazyInit(); lazyInit();
if(pluginManager == null) if(pluginManager == null)
pluginManager = new PluginManager(Config.AssetDirectory + "plugins/"); pluginManager = new PluginManager(Constants.AssetDirectory + "plugins/");
return pluginManager; return pluginManager;
} }
-5
View File
@@ -1,5 +0,0 @@
package core;
public class Settings {
}
+64
View File
@@ -0,0 +1,64 @@
package core;
import dataStructures.*;
import utils.GlobalLog;
import utils.LogFilter;
public abstract class SubCommand
{
private KittyRole roleLevel;
private KittyRating contentRating;
public SubCommand(KittyRole roleLevel, KittyRating contentRating)
{
this.roleLevel = roleLevel;
this.contentRating = contentRating;
}
private void Reject(KittyUser user, String 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)
{
if(guild.contentRating.getValue() < contentRating.getValue())
{
Reject(user, "content rating");
return false;
}
//TODO: ADD CHANNEL CHECK HERE
if(user.getRole().getValue() >= roleLevel.getValue())
{
return true;
}
Reject(user, "permissions");
return false;
}
// Called by the Command manager - this will run the command
// if the issuing user has the permission to do so!
protected final void Invoke(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
{
if(!CanCall(guild, channel, user))
return;
OnRun(guild, channel, user, input);
}
public KittyRating Rating()
{
return contentRating;
}
public KittyRole RequiredRole()
{
return roleLevel;
}
public abstract SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input);
}
+40
View File
@@ -0,0 +1,40 @@
package core;
import dataStructures.KittyEmbed;
import dataStructures.Response;
// Only one isn't null!
public class SubCommandFormattable
{
public final KittyEmbed resEmbed;
public final String resString;
// Default constructor is hidden and disabled.
// If somehow it is called, defaults to an empty string and no embed.
@SuppressWarnings("unused")
private SubCommandFormattable()
{
this.resEmbed = null;
this.resString = "";
}
public SubCommandFormattable(String res)
{
this.resEmbed = null;
this.resString = res;
}
public SubCommandFormattable(KittyEmbed embed)
{
this.resEmbed = embed;
this.resString = null;
}
public void Call(Response res)
{
if(resEmbed == null)
res.send(resString);
else
res.send(resEmbed);
}
}
+34
View File
@@ -0,0 +1,34 @@
package core;
import java.util.HashMap;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyUser;
import utils.GlobalLog;
public class SubCommandFramework
{
HashMap<String, SubCommand> commands = new HashMap<String, SubCommand>();
public SubCommandFramework()
{
}
public void addCommand(String name, SubCommand command)
{
name = name.toLowerCase();
if(commands.put(name, command) != null)
GlobalLog.error("Multiple registration of a name with name '" + 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;
}
}
-2
View File
@@ -30,7 +30,5 @@ public class BenchmarkInput
key = raw.substring(0, whitespacePos).trim(); key = raw.substring(0, whitespacePos).trim();
value = raw.substring(whitespacePos).trim(); value = raw.substring(whitespacePos).trim();
} }
} }

Some files were not shown because too many files have changed in this diff Show More