From 74e2d5ee5b6e11acbb2f8b572224badd7c1dae2a Mon Sep 17 00:00:00 2001 From: AlberLC Date: Fri, 10 Jun 2022 02:20:47 +0200 Subject: [PATCH] Fix _on_users_button_press --- multibot/bots/multi_bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multibot/bots/multi_bot.py b/multibot/bots/multi_bot.py index c1da15d..67d56ab 100644 --- a/multibot/bots/multi_bot.py +++ b/multibot/bots/multi_bot.py @@ -541,8 +541,6 @@ async def _on_users(self, message: Message): ) async def _on_users_button_press(self, message: Message): - await self._accept_button_event(message) - try: button_role_name = message.button_pressed_text.split(maxsplit=1)[1] except IndexError: @@ -550,6 +548,8 @@ async def _on_users_button_press(self, message: Message): if not (role_names := [role.name for role in await self.get_roles(message.chat)]) or button_role_name not in role_names: return + await self._accept_button_event(message) + new_buttons = [] selected_role_names = [] for row in message.original_object.components: