From 597bab672e8d3db9dabdfdaf50502296f990dc93 Mon Sep 17 00:00:00 2001 From: AlberLC Date: Sat, 3 Dec 2022 06:51:09 +0100 Subject: [PATCH] Update FlanaDiscBot.is_punished --- flanabot/bots/flana_disc_bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flanabot/bots/flana_disc_bot.py b/flanabot/bots/flana_disc_bot.py index 5798382..a09e269 100644 --- a/flanabot/bots/flana_disc_bot.py +++ b/flanabot/bots/flana_disc_bot.py @@ -201,12 +201,12 @@ class FlanaDiscBot(DiscordBot, FlanaBot): # -------------------------------------------------------- # # -------------------- PUBLIC METHODS -------------------- # # -------------------------------------------------------- # - async def is_punished(self, user: int | str | User, group_: int | str | Chat | Message): + async def is_punished(self, user: int | str | User, group_: int | str | Chat | Message) -> bool: user = await self.get_user(user, group_) group_id = self.get_group_id(group_) - return group_id in {punishment.group_id for punishment in Punishment.find({ + return bool(Punishment.find({ 'platform': self.platform.value, 'user_id': user.id, 'group_id': group_id, 'is_active': True - })} + }))