=Config file bug fixes
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -32,4 +32,4 @@ public class CommandGuildRoleMain extends Command
|
||||
{
|
||||
framework.run(guild, channel, user, input).Call(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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")));
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class KittyGuild extends DatabaseTrackedObject
|
||||
}
|
||||
|
||||
// Default content for a guild
|
||||
public KittyGuild(String uniqueID, AdminControl adminControl, ArrayList <String> emoji, AudioUtils audio)
|
||||
public KittyGuild(String uniqueID, AdminControl adminControl, ArrayList <String> 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("!");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user