From ef5ebabf816443370f44e1896e373715356bfe49 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 29 Sep 2023 19:41:55 +0200 Subject: [PATCH] Fixed auto-role react --- .../src/modules/auto_role/command/auto_role_group.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/kdb-bot/src/modules/auto_role/command/auto_role_group.py b/kdb-bot/src/modules/auto_role/command/auto_role_group.py index 3df551d4..5a5ee9f2 100644 --- a/kdb-bot/src/modules/auto_role/command/auto_role_group.py +++ b/kdb-bot/src/modules/auto_role/command/auto_role_group.py @@ -220,7 +220,7 @@ class AutoRoleGroup(DiscordCommandABC): ) -> TList[app_commands.Choice[str]]: return await self._auto_role_auto_complete(interaction, current) - @auto_role.command("react") + @auto_role.command() @commands.guild_only() @CommandChecks.check_is_ready() @CommandChecks.check_is_member_moderator() @@ -244,10 +244,8 @@ class AutoRoleGroup(DiscordCommandABC): return for rule in self._auto_roles.get_auto_role_rules_by_auto_role_id(auto_role_from_db.id): - self._bot.loop.create_task( - await self._client_utils.react_to_message_by_auto_role_rule( - auto_role_from_db.discord_channel_id, auto_role_from_db.discord_message_id, rule, ctx.guild - ) + await self._client_utils.react_to_message_by_auto_role_rule( + auto_role_from_db.discord_channel_id, auto_role_from_db.discord_message_id, rule, ctx.guild ) await self._message_service.send_ctx_msg( @@ -256,9 +254,9 @@ class AutoRoleGroup(DiscordCommandABC): ) self._logger.trace(__name__, f"Finished command auto-role react") - @remove.autocomplete("auto_role") + @react.autocomplete("auto_role") async def react_autocomplete( - self, interaction: discord.Interaction, current: str + self, interaction: discord.Interaction, current: str ) -> TList[app_commands.Choice[str]]: return await self._auto_role_auto_complete(interaction, current)