From c9a46b2b078881bcbeeaaa16a68fa01b8740c7ad Mon Sep 17 00:00:00 2001 From: AlberLC Date: Wed, 1 Jun 2022 03:16:45 +0200 Subject: [PATCH] Fix roles mentions in weather --- flanabot/bots/flana_bot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flanabot/bots/flana_bot.py b/flanabot/bots/flana_bot.py index 54e5385..4fd4683 100644 --- a/flanabot/bots/flana_bot.py +++ b/flanabot/bots/flana_bot.py @@ -568,8 +568,9 @@ class FlanaBot(MultiBot, ABC): possible_mentioned_ids.append(user.name.split('#')[0].lower()) possible_mentioned_ids.append(f'@{user.id}') - for role in await self.get_group_roles(message): - possible_mentioned_ids.append(f'@{role.id}') + if roles := await self.get_group_roles(message): + for role in roles: + possible_mentioned_ids.append(f'@{role.id}') original_text_words = flanautils.remove_accents(message.text.lower()) original_text_words = original_text_words.replace(',', ' ').replace(';', ' ').replace('-', ' -')