Make it impossible to add roles with evaluated permissions to self service (because people are stupid enough to do so apparently)
This commit is contained in:
parent
75c699e25b
commit
73f29a5cf1
1 changed files with 14 additions and 0 deletions
|
@ -93,6 +93,20 @@ namespace Geekbot.net.Commands
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (role.IsManaged)
|
||||||
|
{
|
||||||
|
await ReplyAsync("You can't add a role that is managed by discord");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (role.Permissions.ManageRoles
|
||||||
|
|| role.Permissions.Administrator
|
||||||
|
|| role.Permissions.ManageGuild
|
||||||
|
|| role.Permissions.BanMembers
|
||||||
|
|| role.Permissions.KickMembers)
|
||||||
|
{
|
||||||
|
await ReplyAsync("Woah, i don't think you want to add that role to self service as it contains some dangerous permissions");
|
||||||
|
return;
|
||||||
|
}
|
||||||
_redis.HashSet($"{Context.Guild.Id}:RoleWhitelist", new HashEntry[] { new HashEntry(roleName, role.Id.ToString()) });
|
_redis.HashSet($"{Context.Guild.Id}:RoleWhitelist", new HashEntry[] { new HashEntry(roleName, role.Id.ToString()) });
|
||||||
await ReplyAsync($"Added {role.Name} to the whitelist");
|
await ReplyAsync($"Added {role.Name} to the whitelist");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue