=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!
|
WolframNoArgs=You need to provide some arguments!
|
||||||
|
|
||||||
[CommandAddGuildRole]
|
[CommandAddGuildRole]
|
||||||
AddGuildRoleInfo=
|
AddGuildRoleInfo=Add a role to yourself!
|
||||||
AddGuildRoleNotAllowed=You are not allowed to add %s!
|
AddGuildRoleNotAllowed=You are not allowed to add %s!
|
||||||
AddGuildRoleSuccess=Added %s to %s
|
AddGuildRoleSuccess=Added %s to %s
|
||||||
AddGuildRoleFailure=Failed to add %s to %s
|
AddGuildRoleFailure=Failed to add %s to %s
|
||||||
|
|||||||
@@ -20,15 +20,20 @@ public class CommandAllowedGuildRole extends Command
|
|||||||
@Override
|
@Override
|
||||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
{
|
{
|
||||||
String role = input.args.split(" ")[0];
|
String [] roles = input.args.split(",");
|
||||||
if(guild.allowedRole.contains(role))
|
String role;
|
||||||
|
for(int i = 0; i < roles.length; i++)
|
||||||
{
|
{
|
||||||
res.Call(LocStrings.Stub("AllowedGuildRoleDuplicate"));
|
role = roles[i].trim();
|
||||||
}
|
if(guild.allowedRole.contains(role))
|
||||||
else
|
{
|
||||||
{
|
res.Call(LocStrings.Stub("AllowedGuildRoleDuplicate"));
|
||||||
guild.allowedRole.add(role);
|
}
|
||||||
res.Call(String.format(LocStrings.Stub("AllowedGuildRoleSuccess"), role));
|
else
|
||||||
|
{
|
||||||
|
guild.allowedRole.add(role);
|
||||||
|
res.Call(String.format(LocStrings.Stub("AllowedGuildRoleSuccess"), role));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user