diff --git a/assets/config.csv b/assets/config.csv index ec05d59..a36f9dd 100644 --- a/assets/config.csv +++ b/assets/config.csv @@ -9,10 +9,6 @@ "Localized Commands","c++, g++, cplus, cpp","" "Localized Commands","catch","" "Localized Commands","character","" -"Localized Commands","charactercreate","" -"Localized Commands","charactereditbio","" -"Localized Commands","charactereditname","" -"Localized Commands","charactereditURL","" "Localized Commands","choose","" "Localized Commands","color, colour","" "Localized Commands","crouton","" @@ -24,11 +20,6 @@ "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","" @@ -43,10 +34,6 @@ "Localized Commands","ping","" "Localized Commands","poll","" "Localized Commands","raffle","" -"Localized Commands","raffleend","" -"Localized Commands","rafflejoin","" -"Localized Commands","rafflespin","" -"Localized Commands","rafflestart","" "Localized Commands","rating","" "Localized Commands","remind","" "Localized Commands","results","" @@ -55,8 +42,6 @@ "Localized Commands","rpend","" "Localized Commands","rpg","" "Localized Commands","rpstart","" -"Localized Commands","searchcharacter","" -"Localized Commands","showpoll","" "Localized Commands","shutdown","" "Localized Commands","stats","" "Localized Commands","teey","" @@ -89,10 +74,10 @@ "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","CharacterCreateDuplicate","You can't create a character with the same name!" "Localized Strings","CharacterCreateInfo","" -"Localized Strings","CharacterCreateNullInfo","" -"Localized Strings","CharacterCreateSuccess","" +"Localized Strings","CharacterCreateNullInfo","You have to put info in!" +"Localized Strings","CharacterCreateSuccess","I'll store that character for you!" "Localized Strings","CharacterEditBioInfo","Change the short bio for your character! " "Localized Strings","CharacterEditBioNotAuth","You're not authorized to change that character! " "Localized Strings","CharacterEditBioNotValid","" @@ -105,12 +90,12 @@ "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","CharacterInfo","Character is a super command!\n\t`character create \""name\"", \""bio\"", \""ref url\""` will create a new character with those details!\n\t`character editbio \""uniqueID\"", \""new bio\""` will make a new bio for your character!\n\t`character editname \""uniqueID\"", \""new name\""` will make a new name for your character!\n\t`character editbio \""uniqueID\"", \""new refurl\""` will make a new url for your character!\n\t`character search \""name\"" OR \""uniqueID\""` will search for that character!" "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","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!" @@ -158,15 +143,15 @@ "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","GuildRoleAddFailure","I can't add %s to %s." "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","GuildRoleAddSuccess","Added %s to you!" "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","GuildRoleInfo","Role is a super command!\n\t`role add \""role\""` will add a role to you!\n\t`role remove \""role\""` will remove a role!\n\t`role list` will list all the roles you're allowed to add to yourself!\n`ADMIN COMMANDS`\n\t`role allowed \""role\""` will add a role to the list of roles users are allowed to add\n\t`role unallowed \""role\""` will remove a role from the list of roles that users are allowed to add" +"Localized Strings","GuildRoleListEmpty","There are no roles you can add to yourself." "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." @@ -192,6 +177,7 @@ "Localized Strings","MapSeed","Seed" "Localized Strings","MapVersion","Using mapgen v0.1" "Localized Strings","MapWidth","" +"Localized Strings","ModInfo","Mod is a super command for admin or mod use only!\n\t`mod ban @user` will ban a user from the server\n\t`mod kick @user` will kick the user from the server" "Localized Strings","MusicInfo","" "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!" @@ -211,24 +197,25 @@ "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","RaffleEndSuccess","You ended the raffle!" +"Localized Strings","RaffleInfo","Raffle is a super command!\n\t`raffle start \"# of beans\"` will start a raffle with an entrance fee of the number of beans! Defaults to 100.\n\t`raffle end` will stop the raffle!\n\t`raffle spin` will choose a winner, you can only win once!\n\t`raffle join` will add you to the raffle!" +"Localized Strings","RaffleJoinFailure","You can't join again!" "Localized Strings","RaffleJoinInfo","" -"Localized Strings","RaffleJoinSuccess","" +"Localized Strings","RaffleJoinSuccess","You joined the raffle! Good luck!" "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","RaffleStartFailure","I can't start another raffle, try ending the first!" "Localized Strings","RaffleStartInfo","" -"Localized Strings","RaffleStartSuccess","" +"Localized Strings","RaffleStartSuccess","Started a raffle with %s as the cost!" "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","RatingInfo","'0' is fully sfw (Derpi and e621 searches are disabled)\n'1' is filtered (kitty auto appends a sfw tag on any searches)\n'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","RemindInfo","`remind \"# of mins\" \"reminder\"` I'll remind you to do something!" "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","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.\nBlacklist 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;" diff --git a/src/commands/characters/CommandCharacterMain.java b/src/commands/characters/CommandCharacterMain.java index 6066ab1..cc4f1c0 100644 --- a/src/commands/characters/CommandCharacterMain.java +++ b/src/commands/characters/CommandCharacterMain.java @@ -1,6 +1,5 @@ package commands.characters; -import commands.guildrole.*; import core.Command; import core.LocStrings; import core.SubCommandFramework; @@ -12,7 +11,7 @@ public class CommandCharacterMain extends Command public CommandCharacterMain(KittyRole level, KittyRating rating) { super(level, rating); - framework.addCommand("add", new SubCommandAdd(KittyRole.General, KittyRating.Safe)); + framework.addCommand("create", new SubCommandCreate(KittyRole.General, KittyRating.Safe)); framework.addCommand("editbio", new SubCommandEditBio(KittyRole.General, KittyRating.Safe)); framework.addCommand("editname", new SubCommandEditName(KittyRole.General, KittyRating.Safe)); framework.addCommand("editurl", new SubCommandEditURL(KittyRole.General, KittyRating.Safe)); diff --git a/src/commands/characters/SubCommandCreate.java b/src/commands/characters/SubCommandCreate.java index bbe5930..86367e8 100644 --- a/src/commands/characters/SubCommandCreate.java +++ b/src/commands/characters/SubCommandCreate.java @@ -23,6 +23,7 @@ public class SubCommandCreate extends SubCommand { return new SubCommandFormattable (LocStrings.stub("CharacterCreateNullInfo")); } + //user name bio url if(CharacterManager.instance.addCharacter(user, info[0], info[1], info[2])) { return new SubCommandFormattable (LocStrings.stub("CharacterCreateSuccess")); diff --git a/src/commands/guildrole/CommandGuildRoleMain.java b/src/commands/guildrole/CommandGuildRoleMain.java index 010b847..6fbde24 100644 --- a/src/commands/guildrole/CommandGuildRoleMain.java +++ b/src/commands/guildrole/CommandGuildRoleMain.java @@ -32,4 +32,4 @@ public class CommandGuildRoleMain extends Command { framework.run(guild, channel, user, input).Call(res); } -} +} \ No newline at end of file diff --git a/src/commands/guildrole/SubCommandAdd.java b/src/commands/guildrole/SubCommandAdd.java index 3555fe9..2c153b5 100644 --- a/src/commands/guildrole/SubCommandAdd.java +++ b/src/commands/guildrole/SubCommandAdd.java @@ -1,5 +1,6 @@ package commands.guildrole; +import core.LocStrings; import core.SubCommand; import core.SubCommandFormattable; import dataStructures.KittyChannel; @@ -26,16 +27,16 @@ public class SubCommandAdd extends SubCommand { if(guild.control.addRole(user.discordID, role)) { - formatted += "Addded " + role + "!"; + formatted += String.format(LocStrings.stub("GuildRoleAddSuccess"), role, user.name); } else { - formatted += "Failed to add " + role + "!"; + formatted += String.format(LocStrings.stub("GuildRoleAddFailure"), role, user.name); } } else { - formatted += "You're not allowed to add " + role + "!"; + formatted += String.format(LocStrings.stub("GuildRoleAddNotAllowed"), role); } } return new SubCommandFormattable(formatted); diff --git a/src/commands/guildrole/SubCommandList.java b/src/commands/guildrole/SubCommandList.java index f59c292..a4d9b92 100644 --- a/src/commands/guildrole/SubCommandList.java +++ b/src/commands/guildrole/SubCommandList.java @@ -19,7 +19,7 @@ public class SubCommandList extends SubCommand public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input) { String roles = ""; - if(guild.roleList.isEmpty()) + if(guild.roleList.size() < 2) { return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleListEmpty"))); } diff --git a/src/commands/mod/CommandModMain.java b/src/commands/mod/CommandModMain.java index 8ab5e5b..dd1c20c 100644 --- a/src/commands/mod/CommandModMain.java +++ b/src/commands/mod/CommandModMain.java @@ -23,7 +23,7 @@ public class CommandModMain extends Command } @Override - public String getHelpText() { return LocStrings.stub("GuildRoleInfo"); } + public String getHelpText() { return LocStrings.stub("ModInfo"); } @Override public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res) diff --git a/src/commands/raffle/CommandRaffleMain.java b/src/commands/raffle/CommandRaffleMain.java index db5a4f4..9d86205 100644 --- a/src/commands/raffle/CommandRaffleMain.java +++ b/src/commands/raffle/CommandRaffleMain.java @@ -1,6 +1,7 @@ package commands.raffle; import core.Command; +import core.LocStrings; import core.SubCommandFramework; import dataStructures.*; @@ -16,6 +17,9 @@ public class CommandRaffleMain extends Command framework.addCommand("join", new SubCommandJoin(KittyRole.General, KittyRating.Safe)); } + @Override + public String getHelpText() { return LocStrings.stub("RaffleInfo"); } + @Override public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res) { diff --git a/src/commands/raffle/SubCommandStart.java b/src/commands/raffle/SubCommandStart.java index 2b99e47..150c6a7 100644 --- a/src/commands/raffle/SubCommandStart.java +++ b/src/commands/raffle/SubCommandStart.java @@ -34,7 +34,7 @@ public class SubCommandStart extends SubCommand } else { - return new SubCommandFormattable (LocStrings.stub("RaffleStartFailure")); + return new SubCommandFormattable (String.format(LocStrings.stub("RaffleStartFailure"), beanCost)); } } } diff --git a/src/core/ObjectBuilderFactory.java b/src/core/ObjectBuilderFactory.java index 23cae16..8a8235c 100644 --- a/src/core/ObjectBuilderFactory.java +++ b/src/core/ObjectBuilderFactory.java @@ -7,8 +7,8 @@ import java.util.concurrent.Semaphore; import javax.security.auth.login.LoginException; -import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; -import com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager; +//import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; +//import com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager; import core.lua.PluginManager; import dataStructures.*; @@ -20,7 +20,7 @@ import net.dv8tion.jda.core.entities.*; import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent; import offline.Ref; import utils.AdminControl; -import utils.AudioUtils; +//import utils.AudioUtils; import utils.GlobalLog; import utils.LogFilter; @@ -55,7 +55,7 @@ public class ObjectBuilderFactory private static CommandManager commandManager; //Audio track manager - private static AudioPlayerManager audioPlayer = new DefaultAudioPlayerManager(); +// private static AudioPlayerManager audioPlayer = new DefaultAudioPlayerManager(); // 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. @@ -147,8 +147,7 @@ public class ObjectBuilderFactory else { // Construct a new guild with defaults - guild = new KittyGuild(uid, new AdminControl(event.getGuild()), emotesString, - new AudioUtils(event.getGuild(), audioPlayer.createPlayer())); + guild = new KittyGuild(uid, new AdminControl(event.getGuild()), emotesString); DatabaseManager.instance.globalRegister(guild); guildCache.put(uid, guild); } diff --git a/src/core/SubCommandFramework.java b/src/core/SubCommandFramework.java index 2d19a51..b4277c1 100644 --- a/src/core/SubCommandFramework.java +++ b/src/core/SubCommandFramework.java @@ -41,7 +41,10 @@ public class SubCommandFramework } catch(Exception e) { - return new SubCommandFormattable("That's not a valid subcommand!"); + String help = Stats.instance.getHelpText(input.key); + if(help != null) + return new SubCommandFormattable(help); + return new SubCommandFormattable("Something has gone very wrong."); } } } \ No newline at end of file diff --git a/src/dataStructures/KittyGuild.java b/src/dataStructures/KittyGuild.java index 209c69a..7801f79 100644 --- a/src/dataStructures/KittyGuild.java +++ b/src/dataStructures/KittyGuild.java @@ -42,7 +42,7 @@ public class KittyGuild extends DatabaseTrackedObject } // Default content for a guild - public KittyGuild(String uniqueID, AdminControl adminControl, ArrayList emoji, AudioUtils audio) + public KittyGuild(String uniqueID, AdminControl adminControl, ArrayList emoji) { super(uniqueID); this.uniqueID = uniqueID; @@ -54,7 +54,6 @@ public class KittyGuild extends DatabaseTrackedObject this.contentRating = KittyRating.Safe; this.polling = false; this.emoji = emoji; - this.audio = audio; setCommandIndicator("!"); }