WIP on role system
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package commands.guildrole;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import core.Command;
|
||||
import core.ObjectBuilderFactory;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
import dataStructures.Response;
|
||||
import dataStructures.UserInput;
|
||||
import net.dv8tion.jda.core.JDA;
|
||||
|
||||
public class CommandWipeRoles extends Command
|
||||
{
|
||||
|
||||
public CommandWipeRoles(KittyRole roleLevel, KittyRating contentRating) {super(roleLevel, contentRating);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
JDA kitty = res.getKitty();
|
||||
ArrayList guilds = (ArrayList) kitty.getGuilds();
|
||||
KittyGuild guildx;
|
||||
|
||||
for(int i = 0; i < guilds.size(); i ++)
|
||||
{
|
||||
guildx = ObjectBuilderFactory.extractGuild
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package commands.guildrole;
|
||||
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
import dataStructures.UserInput;
|
||||
|
||||
public class SubCommandWipeRoles extends SubCommand
|
||||
{
|
||||
public SubCommandWipeRoles(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,8 @@ public class ObjectBuilderFactory
|
||||
else
|
||||
{
|
||||
// Construct a new guild with defaults
|
||||
guild = new KittyGuild(uid, new AdminControl(event.getGuild()), emotesString, new AudioUtils(event.getGuild(), playerManager), channels);
|
||||
guild = new KittyGuild(uid, new AdminControl(event.getGuild()), emotesString,
|
||||
new AudioUtils(event.getGuild(), playerManager), channels);
|
||||
DatabaseManager.instance.globalRegister(guild);
|
||||
guildCache.put(uid, guild);
|
||||
}
|
||||
@@ -176,6 +177,8 @@ public class ObjectBuilderFactory
|
||||
return guild;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Explicitly locks: guildCache
|
||||
public static KittyRole extractRole(GuildMessageReceivedEvent event)
|
||||
{
|
||||
|
||||
@@ -143,4 +143,11 @@ public class Response
|
||||
GlobalLog.log(LogFilter.Response, "Sending input stream response");
|
||||
event.getChannel().sendFile(in, "return." + extension).queue();
|
||||
}
|
||||
|
||||
//Sends Kittybot as an object
|
||||
//WARNING: THIS WILL EDIT THE ENTIRE BOT, DO NOT USE LIGHTLY
|
||||
public JDA getKitty()
|
||||
{
|
||||
return kitty;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -118,7 +118,8 @@ public class Main extends ListenerAdapter
|
||||
{
|
||||
if(pluginOutput.get(i).startsWith("!"))
|
||||
{
|
||||
commandManager.invokeOnNewThread(guild, channel, user, new UserInput(pluginOutput.get(i).substring(1), guild), response);
|
||||
commandManager.invokeOnNewThread(guild, channel, user,
|
||||
new UserInput(pluginOutput.get(i).substring(1), guild), response);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user