From 402ddb061c5c4d08494f241d3747cd424951be91 Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Sun, 28 Aug 2016 14:40:34 -0500 Subject: [PATCH] Corrected what exception would be hit if custom_perms is not found --- cogs/mod.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/mod.py b/cogs/mod.py index 00c0b67..41400f4 100644 --- a/cogs/mod.py +++ b/cogs/mod.py @@ -118,10 +118,10 @@ class Mod: perms_value = server_perms.get(cmd.qualified_name) if perms_value is None: # If we don't find custom permissions, get the required permission for a command - # based on what we set in checks.custom_perms, if custom_perms isn't found, we'll get a KeyError + # based on what we set in checks.custom_perms, if custom_perms isn't found, we'll get an IndexError try: custom_perms = [func for func in cmd.checks if "custom_perms" in func.__qualname__][0] - except KeyError: + except IndexError: # Loop through and check if there is a check called is_owner, if we loop through and don't find one # This means that the only other choice is to be able to manage the server (for the checks on perm commands) for func in cmd.checks: