+Added Discord Role System

Added system to allow users to edit roles that the admins of each server gives access to
This commit is contained in:
Alex Stewart
2019-04-15 00:14:14 -07:00
parent fb1f6b48ba
commit 9f4aac3e21
8 changed files with 173 additions and 9 deletions
+34
View File
@@ -0,0 +1,34 @@
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 CommandAllowedGuildRole extends Command
{
public CommandAllowedGuildRole(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return LocStrings.Stub("AllowedGuildRoleInfo"); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
String role = input.args.split(" ")[0];
if(guild.allowedRole.contains(role))
{
res.Call(LocStrings.Stub("AllowedGuildRoleDuplicate"));
}
else
{
guild.allowedRole.add(role);
res.Call(String.format(LocStrings.Stub("AllowedGuildRoleSuccess"), role));
}
}
}