Added an... important bit
Again
This commit is contained in:
parent
17c98b6edd
commit
ea2cc31289
1 changed files with 6 additions and 0 deletions
|
@ -49,6 +49,12 @@ public class RoleCommand extends DiscordCommandBase {
|
||||||
DiscordPlugin.sendMessageToChannel(message.getChannel(),
|
DiscordPlugin.sendMessageToChannel(message.getChannel(),
|
||||||
"List of game roles:\n" + DiscordPlugin.GameRoles.stream().collect(Collectors.joining("\n")));
|
"List of game roles:\n" + DiscordPlugin.GameRoles.stream().collect(Collectors.joining("\n")));
|
||||||
} else if (argsa[0].equalsIgnoreCase("addrole")) {
|
} else if (argsa[0].equalsIgnoreCase("addrole")) {
|
||||||
|
if (!message.getAuthor().getRolesForGuild(DiscordPlugin.mainServer).stream()
|
||||||
|
.anyMatch(r -> r.getName().equals("Moderator"))) {
|
||||||
|
DiscordPlugin.sendMessageToChannel(message.getChannel(),
|
||||||
|
"You need to be a moderator to use this command.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
final List<IRole> roles = (TBMCCoreAPI.IsTestServer() ? DiscordPlugin.devServer : DiscordPlugin.mainServer)
|
final List<IRole> roles = (TBMCCoreAPI.IsTestServer() ? DiscordPlugin.devServer : DiscordPlugin.mainServer)
|
||||||
.getRolesByName(argsa[1]);
|
.getRolesByName(argsa[1]);
|
||||||
if (roles.size() == 0) {
|
if (roles.size() == 0) {
|
||||||
|
|
Loading…
Reference in a new issue