=Fixed role case issue
This commit is contained in:
@@ -22,21 +22,21 @@ public class SubCommandAdd extends SubCommand
|
||||
String formatted = "";
|
||||
for(int i = 0; i < roles.length; i++)
|
||||
{
|
||||
role = roles[i].trim();
|
||||
role = roles[i].trim().toLowerCase();
|
||||
if(guild.roleList.contains(role))
|
||||
{
|
||||
if(guild.control.addRole(user.discordID, role))
|
||||
{
|
||||
formatted += String.format(LocStrings.stub("GuildRoleAddSuccess"), role, user.name);
|
||||
formatted += String.format(LocStrings.stub("GuildRoleAddSuccess"), role, user.name) + "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
formatted += String.format(LocStrings.stub("GuildRoleAddFailure"), role, user.name);
|
||||
formatted += String.format(LocStrings.stub("GuildRoleAddFailure"), role, user.name) + "\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
formatted += String.format(LocStrings.stub("GuildRoleAddNotAllowed"), role);
|
||||
formatted += String.format(LocStrings.stub("GuildRoleAddNotAllowed"), role) + "\n";
|
||||
}
|
||||
}
|
||||
return new SubCommandFormattable(formatted);
|
||||
|
||||
@@ -29,6 +29,6 @@ public class SubCommandList extends SubCommand
|
||||
roles += "\n";
|
||||
roles += guild.roleList.get(i);
|
||||
}
|
||||
return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleListOutput"), roles));
|
||||
return new SubCommandFormattable(String.format(LocStrings.stub("GuildRoleListOutput") + "\n", roles));
|
||||
}
|
||||
}
|
||||
@@ -12,23 +12,29 @@ public class SubCommandRemove extends SubCommand
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input)
|
||||
{
|
||||
String role = input.args.split(" ")[0];
|
||||
String [] roles = input.args.split(",");
|
||||
String role;
|
||||
String formatted = "";
|
||||
if(guild.roleList.contains(role))
|
||||
for(int i = 0; i < roles.length; i ++)
|
||||
{
|
||||
if(guild.control.removeRole(user.discordID, role))
|
||||
role = roles[i].trim().toLowerCase();
|
||||
if(guild.roleList.contains(role))
|
||||
{
|
||||
formatted += (String.format(LocStrings.stub("GuildRoleRemoveSuccess"), role, user.name));
|
||||
if(guild.control.removeRole(user.discordID, role))
|
||||
{
|
||||
formatted += (String.format(LocStrings.stub("GuildRoleRemoveSuccess"), role, user.name)) + "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
formatted += (String.format(LocStrings.stub("GuildRoleRemoveFailure"), role, user.name)) + "\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
formatted += (String.format(LocStrings.stub("GuildRoleRemoveFailure"), role, user.name));
|
||||
formatted += (String.format(LocStrings.stub("GuildRoleRemoveNotAllowed"), role)) + "\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
formatted += (String.format(LocStrings.stub("GuildRoleRemoveNotAllowed"), role));
|
||||
}
|
||||
|
||||
|
||||
return new SubCommandFormattable(formatted);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user