Skip to content

Commit 35cb543

Browse files
authored
Merge pull request #998 from allthingslinux/snippet-permissions-fix
fix: replace CheckFailure with PermissionLevelError in SnippetsBaseCog
2 parents c9c539e + 43d7a10 commit 35cb543

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tux/cogs/snippets/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from tux.utils import checks
1111
from tux.utils.config import Config
1212
from tux.utils.constants import CONST
13+
from tux.utils.exceptions import PermissionLevelError
1314

1415

1516
class SnippetsBaseCog(commands.Cog):
@@ -109,7 +110,8 @@ async def check_if_user_has_mod_override(self, ctx: commands.Context[Tux]) -> bo
109110
"""Check if the user invoking the command has moderator permissions (PL >= configured level)."""
110111
try:
111112
await checks.has_pl(2).predicate(ctx)
112-
except commands.CheckFailure:
113+
except PermissionLevelError:
114+
# this happens if the user is not a mod
113115
return False
114116
except Exception as e:
115117
logger.error(f"Unexpected error in check_if_user_has_mod_override: {e}")

0 commit comments

Comments
 (0)