Merge remote-tracking branch 'origin/develop' into feature/collapsed_configs
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package commands;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
import dataStructures.Response;
|
||||
import dataStructures.UserInput;
|
||||
|
||||
public class CommandGuildRoleRemove extends Command
|
||||
{
|
||||
public CommandGuildRoleRemove(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String getHelpText() { return LocStrings.stub("GuildRoleRemoveInfo"); };
|
||||
|
||||
@Override
|
||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
String role = input.args.split(" ")[0];
|
||||
if(guild.roleList.contains(role))
|
||||
{
|
||||
if(guild.control.removeRole(user.discordID, role))
|
||||
{
|
||||
res.send(String.format(LocStrings.stub("GuildRoleRemoveSuccess"), role, user.name));
|
||||
}
|
||||
else
|
||||
{
|
||||
res.send(String.format(LocStrings.stub("GuildRoleRemoveFailure"), role, user.name));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
res.send(String.format(LocStrings.stub("GuildRoleRemoveNotAllowed"), role));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.image.BufferedImage;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.*;
|
||||
import dataStructures.KittyChannel;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.CharacterManager;
|
||||
import core.Command;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.CharacterManager;
|
||||
import core.Command;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.CharacterManager;
|
||||
import core.Command;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.CharacterManager;
|
||||
import core.Command;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.*;
|
||||
import dataStructures.KittyChannel;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics2D;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.Constants;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.*;
|
||||
import dataStructures.KittyChannel;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.*;
|
||||
import dataStructures.KittyChannel;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.image.BufferedImage;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.*;
|
||||
import dataStructures.KittyChannel;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.*;
|
||||
import dataStructures.KittyChannel;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.*;
|
||||
import dataStructures.*;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.*;
|
||||
import dataStructures.*;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -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.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.util.Stack;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.DatabaseManager;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.image.BufferedImage;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -1,4 +1,4 @@
|
||||
package commands;
|
||||
package commands.general;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -0,0 +1,36 @@
|
||||
package commands.guildrole;
|
||||
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
|
||||
public class CommandGuildRoleAdd extends SubCommand
|
||||
{
|
||||
public CommandGuildRoleAdd(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
{
|
||||
String role = input.split(" ")[0];
|
||||
if(guild.roleList.contains(role))
|
||||
{
|
||||
if(guild.control.addRole(user.discordID, role))
|
||||
{
|
||||
return new SubCommandFormattable("ADDED RIN YOU NEED TO FIX THIS");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new SubCommandFormattable("FAILED RIN YOU NEED TO FIX THIS TOO");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return new SubCommandFormattable("NOT ALLOWED FIX THIS ONE TOO SNEP FACE");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package commands.guildrole;
|
||||
|
||||
import core.LocStrings;
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
|
||||
public class CommandGuildRoleAllowed extends SubCommand
|
||||
{
|
||||
public CommandGuildRoleAllowed(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
{
|
||||
String [] roles = input.split(",");
|
||||
String role;
|
||||
String formatted = "";
|
||||
for(int i = 0; i < roles.length; i++)
|
||||
{
|
||||
role = roles[i].trim();
|
||||
if(guild.roleList.contains(role))
|
||||
{
|
||||
formatted += String.format(LocStrings.stub("GuildRoleAllowedDuplicate"), role);
|
||||
}
|
||||
else
|
||||
{
|
||||
guild.roleList.add(role);
|
||||
formatted += (String.format(LocStrings.stub("GuildRoleAllowedSuccess"), role));
|
||||
}
|
||||
}
|
||||
return new SubCommandFormattable(formatted);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package commands.guildrole;
|
||||
|
||||
import core.LocStrings;
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
|
||||
public class CommandGuildRoleList extends SubCommand
|
||||
{
|
||||
|
||||
public CommandGuildRoleList(KittyRole level, KittyRating rating) { super(level, rating);}
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
{
|
||||
String roles = "";
|
||||
if(guild.roleList.isEmpty())
|
||||
{
|
||||
return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleListEmpty")));
|
||||
}
|
||||
for(int i = 0; i < guild.roleList.size(); i++)
|
||||
{
|
||||
if(i > 0)
|
||||
roles += "\n";
|
||||
roles += guild.roleList.get(i);
|
||||
}
|
||||
return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleListOutput"), roles));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package commands.guildrole;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
import core.SubCommandFramework;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
import dataStructures.Response;
|
||||
import dataStructures.UserInput;
|
||||
|
||||
public class CommandGuildRoleMain extends Command
|
||||
{
|
||||
SubCommandFramework framework = new SubCommandFramework();
|
||||
public CommandGuildRoleMain(KittyRole level, KittyRating rating)
|
||||
{
|
||||
super(level, rating);
|
||||
framework.addCommand("add", new CommandGuildRoleAdd (KittyRole.General, KittyRating.Safe));
|
||||
framework.addCommand("remove", new CommandGuildRoleRemove(KittyRole.General, KittyRating.Safe));
|
||||
framework.addCommand("allowed", new CommandGuildRoleAllowed(KittyRole.Admin, KittyRating.Safe));
|
||||
framework.addCommand("unallowed", new CommandGuildRoleNotAllowed(KittyRole.Admin, KittyRating.Safe));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpText() { return LocStrings.stub("GuildRoleInfo"); }
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
framework.run(guild, channel, user, input.args).Call(res);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package commands.guildrole;
|
||||
|
||||
import core.LocStrings;
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
|
||||
public class CommandGuildRoleNotAllowed extends SubCommand
|
||||
{
|
||||
public CommandGuildRoleNotAllowed(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
{
|
||||
input = input.toLowerCase();
|
||||
String [] roles = input.split(",");
|
||||
for(String role:roles)
|
||||
{
|
||||
if(guild.roleList.contains(role.trim()))
|
||||
{
|
||||
guild.roleList.remove(role);
|
||||
return new SubCommandFormattable(LocStrings.stub("GuildRoleNotAllowedSuccess"));
|
||||
}
|
||||
else
|
||||
{
|
||||
return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleNotAllowedFailure"), role));
|
||||
}
|
||||
}
|
||||
return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleNotAllowedNoArgs")));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package commands.guildrole;
|
||||
|
||||
import core.LocStrings;
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.*;
|
||||
|
||||
public class CommandGuildRoleRemove extends SubCommand
|
||||
{
|
||||
public CommandGuildRoleRemove(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
{
|
||||
String role = input.split(" ")[0];
|
||||
String formatted = "";
|
||||
if(guild.roleList.contains(role))
|
||||
{
|
||||
if(guild.control.removeRole(user.discordID, role))
|
||||
{
|
||||
formatted += (String.format(LocStrings.stub("GuildRoleRemoveSuccess"), role, user.name));
|
||||
}
|
||||
else
|
||||
{
|
||||
formatted += (String.format(LocStrings.stub("GuildRoleRemoveFailure"), role, user.name));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
formatted += (String.format(LocStrings.stub("GuildRoleRemoveNotAllowed"), role));
|
||||
}
|
||||
|
||||
return new SubCommandFormattable(formatted);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import java.util.concurrent.Semaphore;
|
||||
|
||||
import javax.security.auth.login.LoginException;
|
||||
|
||||
import commands.general.*;
|
||||
import commands.guildrole.CommandGuildRoleMain;
|
||||
import core.lua.PluginManager;
|
||||
import dataStructures.*;
|
||||
import main.Main;
|
||||
@@ -377,6 +379,60 @@ public class ObjectBuilderFactory
|
||||
|
||||
return commandManager;
|
||||
|
||||
// Admin
|
||||
manager.register(LocCommands.stub("rating"), new CommandRating(KittyRole.Admin, KittyRating.Safe));
|
||||
manager.register(LocCommands.stub("indicator"), new CommandChangeIndicator(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("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("kittyrole"), 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("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));
|
||||
manager.register(LocCommands.stub("remind"), new CommandRemind(KittyRole.General, KittyRating.Safe));
|
||||
manager.register(LocCommands.stub("role"), new CommandGuildRoleMain(KittyRole.General, KittyRating.Safe));
|
||||
|
||||
return manager;
|
||||
}
|
||||
|
||||
// Default database manager construction. It can be constructed
|
||||
|
||||
@@ -22,11 +22,12 @@ public class SubCommandFramework
|
||||
if(commands.put(name, command) != null)
|
||||
GlobalLog.error("Multiple registration of a name with name '" + name + "'!");
|
||||
|
||||
GlobalLog.log("Registered " + name);
|
||||
GlobalLog.log("Registered SubCommand " + name);
|
||||
}
|
||||
|
||||
public SubCommandFormattable run(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
{
|
||||
System.out.print(input);
|
||||
SubCommandFormattable res = commands.get(input.split(" ")[0].toLowerCase()).OnRun(guild, channel, user, input.substring(input.indexOf(" ")));
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user