=Added array input to AllowedGuildRole

Users can now enter in multiple roles by separating them with a comma in the command
This commit is contained in:
Alex Stewart
2019-04-15 14:57:11 -07:00
parent 9f4aac3e21
commit 469fe0922e
2 changed files with 14 additions and 9 deletions
+13 -8
View File
@@ -20,15 +20,20 @@ public class CommandAllowedGuildRole extends Command
@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))
String [] roles = input.args.split(",");
String role;
for(int i = 0; i < roles.length; i++)
{
res.Call(LocStrings.Stub("AllowedGuildRoleDuplicate"));
}
else
{
guild.allowedRole.add(role);
res.Call(String.format(LocStrings.Stub("AllowedGuildRoleSuccess"), role));
role = roles[i].trim();
if(guild.allowedRole.contains(role))
{
res.Call(LocStrings.Stub("AllowedGuildRoleDuplicate"));
}
else
{
guild.allowedRole.add(role);
res.Call(String.format(LocStrings.Stub("AllowedGuildRoleSuccess"), role));
}
}
}
}