=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:
+1
-1
@@ -172,7 +172,7 @@ WolframInfo=Will query wolframalpha with your question and give a full image out
|
||||
WolframNoArgs=You need to provide some arguments!
|
||||
|
||||
[CommandAddGuildRole]
|
||||
AddGuildRoleInfo=
|
||||
AddGuildRoleInfo=Add a role to yourself!
|
||||
AddGuildRoleNotAllowed=You are not allowed to add %s!
|
||||
AddGuildRoleSuccess=Added %s to %s
|
||||
AddGuildRoleFailure=Failed to add %s to %s
|
||||
|
||||
@@ -20,7 +20,11 @@ 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];
|
||||
String [] roles = input.args.split(",");
|
||||
String role;
|
||||
for(int i = 0; i < roles.length; i++)
|
||||
{
|
||||
role = roles[i].trim();
|
||||
if(guild.allowedRole.contains(role))
|
||||
{
|
||||
res.Call(LocStrings.Stub("AllowedGuildRoleDuplicate"));
|
||||
@@ -31,4 +35,5 @@ public class CommandAllowedGuildRole extends Command
|
||||
res.Call(String.format(LocStrings.Stub("AllowedGuildRoleSuccess"), role));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user