Error when removing non-existing role from whitelist

This commit is contained in:
Runebaas 2018-02-03 15:14:11 +01:00
parent ffaedfa962
commit 91d178049b
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6

View file

@ -134,8 +134,16 @@ namespace Geekbot.net.Commands
{ {
try try
{ {
_redis.HashDelete($"{Context.Guild.Id}:RoleWhitelist", roleName);
await ReplyAsync($"Removed {roleName} from the whitelist"); var success = _redis.HashDelete($"{Context.Guild.Id}:RoleWhitelist", roleName.ToLower());
if (success)
{
await ReplyAsync($"Removed {roleName} from the whitelist");
return;
}
await ReplyAsync("There is not whitelisted role with that name...");
} }
catch (Exception e) catch (Exception e)
{ {