diff --git a/jarvis/client.py b/jarvis/client.py index 65065a8..fe6abef 100644 --- a/jarvis/client.py +++ b/jarvis/client.py @@ -775,10 +775,12 @@ class Jarvis(Client): async def on_button(self, event: Button) -> None: """Process button events.""" context = event.context + + if not context.custom_id.startswith("modcase|"): + return # await super().on_button(event) + if not context.deferred and not context.responded: await context.defer(ephemeral=True) - if not context.custom_id.startswith("modcase|"): - return await super().on_button(event) if not context.author.has_permission(Permissions.MODERATE_MEMBERS): return diff --git a/jarvis/cogs/botutil.py b/jarvis/cogs/botutil.py index 4e8008b..96617ea 100644 --- a/jarvis/cogs/botutil.py +++ b/jarvis/cogs/botutil.py @@ -20,7 +20,7 @@ class BotutilCog(Extension): def __init__(self, bot: Client): self.bot = bot self.logger = logging.getLogger(__name__) - self.add_cog_check(self.is_owner) + self.add_ext_check(self.is_owner) async def is_owner(self, ctx: PrefixedContext) -> bool: """Checks if author is bot owner.""" diff --git a/jarvis/utils/cogs.py b/jarvis/utils/cogs.py index a308fcf..3794b1e 100644 --- a/jarvis/utils/cogs.py +++ b/jarvis/utils/cogs.py @@ -20,7 +20,7 @@ class ModcaseCog(Extension): def __init__(self, bot: Client): self.bot = bot self.logger = logging.getLogger(__name__) - self.add_cog_postrun(self.log) + self.add_extension_postrun(self.log) async def log(self, ctx: InteractionContext, *_args: list, **kwargs: dict) -> None: """