Skip to content

Commit

Permalink
Fix _on_users_button_press
Browse files Browse the repository at this point in the history
  • Loading branch information
AlberLC committed Jun 10, 2022
1 parent 22bf0bb commit 74e2d5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions multibot/bots/multi_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,15 +541,15 @@ 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:
return
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:
Expand Down

0 comments on commit 74e2d5e

Please sign in to comment.