From 9130dfb2b8962a8167666a9af95f4a5914adc0ca Mon Sep 17 00:00:00 2001 From: Damego Date: Mon, 23 Jan 2023 17:37:14 +0500 Subject: [PATCH] fix: `client`, `command` and `extension` are missed in `on_command` event --- interactions/api/gateway/client.py | 1 - interactions/client/models/command.py | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/interactions/api/gateway/client.py b/interactions/api/gateway/client.py index 73bce8ac4..d8a681d6a 100644 --- a/interactions/api/gateway/client.py +++ b/interactions/api/gateway/client.py @@ -404,7 +404,6 @@ def _dispatch_interaction_event(self, data: dict) -> None: _option = self.__sub_command_context(option, _context) __kwargs.update(_option) - self._dispatch.dispatch("on_command", _context) elif data["type"] == InteractionType.MESSAGE_COMPONENT: _name = f"component_{_context.data.custom_id}" diff --git a/interactions/client/models/command.py b/interactions/client/models/command.py index 4d9f50023..d3b46527e 100644 --- a/interactions/client/models/command.py +++ b/interactions/client/models/command.py @@ -897,6 +897,8 @@ async def wrapper(ctx: "CommandContext", *args, **kwargs): ctx.command = self ctx.extension = self.extension + self.listener.dispatch("on_command", ctx) + try: if self.extension: return await coro(self.extension, ctx, *args, **kwargs)