=Fixed role case issue
This commit is contained in:
+3
-3
@@ -159,7 +159,7 @@
|
|||||||
"Localized Strings","GuildRoleNotAllowedSuccess","Removed %s from the allowed roles!"
|
"Localized Strings","GuildRoleNotAllowedSuccess","Removed %s from the allowed roles!"
|
||||||
"Localized Strings","GuildRoleRemoveFailure","I wasn't able to remove %s from %s!"
|
"Localized Strings","GuildRoleRemoveFailure","I wasn't able to remove %s from %s!"
|
||||||
"Localized Strings","GuildRoleRemoveInfo","Removes a role from you! Just remember to spell it right!"
|
"Localized Strings","GuildRoleRemoveInfo","Removes a role from you! Just remember to spell it right!"
|
||||||
"Localized Strings","GuildRoleRemoveNotAllowed","You're not allowed to add %s!"
|
"Localized Strings","GuildRoleRemoveNotAllowed","You're not allowed to remove %s!"
|
||||||
"Localized Strings","GuildRoleRemoveSuccess","Removed %s from %s!"
|
"Localized Strings","GuildRoleRemoveSuccess","Removed %s from %s!"
|
||||||
"Localized Strings","HelpBuilderInfo","Emit help for all commands as formatted HTML"
|
"Localized Strings","HelpBuilderInfo","Emit help for all commands as formatted HTML"
|
||||||
"Localized Strings","HelpDisplay","You can get help with a specific command by typing `!help command`! General Commands: `boop, roll, choose, help, info, vote, results, showpoll, wolfram, cplus, java, beans, role, bet, yeet`"
|
"Localized Strings","HelpDisplay","You can get help with a specific command by typing `!help command`! General Commands: `boop, roll, choose, help, info, vote, results, showpoll, wolfram, cplus, java, beans, role, bet, yeet`"
|
||||||
@@ -198,7 +198,7 @@
|
|||||||
"Localized Strings","RaffleEndFailure","I don't think there's one going!"
|
"Localized Strings","RaffleEndFailure","I don't think there's one going!"
|
||||||
"Localized Strings","RaffleEndInfo",""
|
"Localized Strings","RaffleEndInfo",""
|
||||||
"Localized Strings","RaffleEndSuccess","You ended the raffle!"
|
"Localized Strings","RaffleEndSuccess","You ended the raffle!"
|
||||||
"Localized Strings","RaffleInfo","Raffle is a super command!\n\t`raffle start \"# of beans\"` will start a raffle with an entrance fee of the number of beans! Defaults to 100.\n\t`raffle end` will stop the raffle!\n\t`raffle spin` will choose a winner, you can only win once!\n\t`raffle join` will add you to the raffle!"
|
"Localized Strings","RaffleInfo","Raffle is a super command!\n\t`raffle start \""# of beans\""` will start a raffle with an entrance fee of the number of beans! Defaults to 100.\n\t`raffle end` will stop the raffle!\n\t`raffle spin` will choose a winner, you can only win once!\n\t`raffle join` will add you to the raffle!"
|
||||||
"Localized Strings","RaffleJoinFailure","You can't join again!"
|
"Localized Strings","RaffleJoinFailure","You can't join again!"
|
||||||
"Localized Strings","RaffleJoinInfo",""
|
"Localized Strings","RaffleJoinInfo",""
|
||||||
"Localized Strings","RaffleJoinSuccess","You joined the raffle! Good luck!"
|
"Localized Strings","RaffleJoinSuccess","You joined the raffle! Good luck!"
|
||||||
@@ -212,7 +212,7 @@
|
|||||||
"Localized Strings","RatingInfo","'0' is fully sfw (Derpi and e621 searches are disabled)\n'1' is filtered (kitty auto appends a sfw tag on any searches)\n'2' is nsfw (any search will go through). Some other words are supported for setting filter as well."
|
"Localized Strings","RatingInfo","'0' is fully sfw (Derpi and e621 searches are disabled)\n'1' is filtered (kitty auto appends a sfw tag on any searches)\n'2' is nsfw (any search will go through). Some other words are supported for setting filter as well."
|
||||||
"Localized Strings","RatingInvalid","Invalid content rating"
|
"Localized Strings","RatingInvalid","Invalid content rating"
|
||||||
"Localized Strings","RatingWarning","Warning: NSFW may slip through, images are only based on tags on their respective sites!"
|
"Localized Strings","RatingWarning","Warning: NSFW may slip through, images are only based on tags on their respective sites!"
|
||||||
"Localized Strings","RemindInfo","`remind \"# of mins\" \"reminder\"` I'll remind you to do something!"
|
"Localized Strings","RemindInfo","`remind \""# of mins\"" \""reminder\""` I'll remind you to do something!"
|
||||||
"Localized Strings","RoleChanged","Changed %s to role `%s`!"
|
"Localized Strings","RoleChanged","Changed %s to role `%s`!"
|
||||||
"Localized Strings","RoleError","You aren't allowed to do that! You must have the KittyRole '%' or higher!"
|
"Localized Strings","RoleError","You aren't allowed to do that! You must have the KittyRole '%' or higher!"
|
||||||
"Localized Strings","RoleInfo","Will show the current role you have, Admins can change others roles with input of 'role x @y' with x being blacklist, general, mod, or admin.\nBlacklist will not allow the user to interact with kitty anymore, general mod and admin will give the user access to those commands."
|
"Localized Strings","RoleInfo","Will show the current role you have, Admins can change others roles with input of 'role x @y' with x being blacklist, general, mod, or admin.\nBlacklist will not allow the user to interact with kitty anymore, general mod and admin will give the user access to those commands."
|
||||||
|
|||||||
|
Can't render this file because it contains an unexpected character in line 201 and column 80.
|
@@ -22,21 +22,21 @@ public class SubCommandAdd extends SubCommand
|
|||||||
String formatted = "";
|
String formatted = "";
|
||||||
for(int i = 0; i < roles.length; i++)
|
for(int i = 0; i < roles.length; i++)
|
||||||
{
|
{
|
||||||
role = roles[i].trim();
|
role = roles[i].trim().toLowerCase();
|
||||||
if(guild.roleList.contains(role))
|
if(guild.roleList.contains(role))
|
||||||
{
|
{
|
||||||
if(guild.control.addRole(user.discordID, 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
|
else
|
||||||
{
|
{
|
||||||
formatted += String.format(LocStrings.stub("GuildRoleAddFailure"), role, user.name);
|
formatted += String.format(LocStrings.stub("GuildRoleAddFailure"), role, user.name) + "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
formatted += String.format(LocStrings.stub("GuildRoleAddNotAllowed"), role);
|
formatted += String.format(LocStrings.stub("GuildRoleAddNotAllowed"), role) + "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubCommandFormattable(formatted);
|
return new SubCommandFormattable(formatted);
|
||||||
|
|||||||
@@ -29,6 +29,6 @@ public class SubCommandList extends SubCommand
|
|||||||
roles += "\n";
|
roles += "\n";
|
||||||
roles += guild.roleList.get(i);
|
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
|
@Override
|
||||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input)
|
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 = "";
|
String formatted = "";
|
||||||
|
for(int i = 0; i < roles.length; i ++)
|
||||||
|
{
|
||||||
|
role = roles[i].trim().toLowerCase();
|
||||||
if(guild.roleList.contains(role))
|
if(guild.roleList.contains(role))
|
||||||
{
|
{
|
||||||
if(guild.control.removeRole(user.discordID, role))
|
if(guild.control.removeRole(user.discordID, role))
|
||||||
{
|
{
|
||||||
formatted += (String.format(LocStrings.stub("GuildRoleRemoveSuccess"), role, user.name));
|
formatted += (String.format(LocStrings.stub("GuildRoleRemoveSuccess"), role, user.name)) + "\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
formatted += (String.format(LocStrings.stub("GuildRoleRemoveFailure"), role, user.name));
|
formatted += (String.format(LocStrings.stub("GuildRoleRemoveFailure"), role, user.name)) + "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
formatted += (String.format(LocStrings.stub("GuildRoleRemoveNotAllowed"), role));
|
formatted += (String.format(LocStrings.stub("GuildRoleRemoveNotAllowed"), role)) + "\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new SubCommandFormattable(formatted);
|
return new SubCommandFormattable(formatted);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user