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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user