From 4dd78ffae9f8ca468333b82682faec5281be561b Mon Sep 17 00:00:00 2001 From: tandemdude <43570299+tandemdude@users.noreply.github.com> Date: Wed, 1 May 2024 10:05:26 +0100 Subject: [PATCH] Bump hikari version and fix global commands not working --- lightbulb/client.py | 5 ++++- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lightbulb/client.py b/lightbulb/client.py index 00eb8c4..91ebb55 100644 --- a/lightbulb/client.py +++ b/lightbulb/client.py @@ -482,9 +482,12 @@ def _resolve_options_and_command( command_path.append(subcommand.name) options = subcommand.options - root_commands = self._commands.get(interaction.guild_id or constants.GLOBAL_COMMAND_KEY, {}).get( + global_commands = self._commands.get(constants.GLOBAL_COMMAND_KEY, {}).get(interaction.command_name) + guild_commands = self._commands.get(interaction.guild_id or constants.GLOBAL_COMMAND_KEY, {}).get( interaction.command_name ) + # TODO - fix this when hikari adds the guild_id from interaction data to the model + root_commands = guild_commands or global_commands if root_commands is None: LOGGER.debug("ignoring interaction received for unknown command - %r", interaction.command_name) return diff --git a/pyproject.toml b/pyproject.toml index edc0504..b0a7c12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed", ] -dependencies = ["hikari>=2.0.0.dev122, <3", "svcs>=23.21.0, <24"] +dependencies = ["hikari>=2.0.0.dev125, <3", "svcs>=23.21.0, <24"] dynamic = ["version", "description"] [project.urls]