From a24021c2bdc5a1e89f76a577f115faba9d3b20b2 Mon Sep 17 00:00:00 2001 From: AlberLC Date: Fri, 3 Mar 2023 05:19:52 +0100 Subject: [PATCH] Update FlanaBot.check_old_database_actions --- flanabot/bots/flana_bot.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flanabot/bots/flana_bot.py b/flanabot/bots/flana_bot.py index 2973ab7..ef0eec9 100644 --- a/flanabot/bots/flana_bot.py +++ b/flanabot/bots/flana_bot.py @@ -357,10 +357,9 @@ class FlanaBot(Connect4Bot, PenaltyBot, PollBot, ScraperBot, WeatherBot, MultiBo # -------------------------------------------------------- # # -------------------- PUBLIC METHODS -------------------- # # -------------------------------------------------------- # - @staticmethod - def check_old_database_actions(): + def check_old_database_actions(self): before_date = datetime.datetime.now(datetime.timezone.utc) - multibot_constants.DATABASE_MESSAGE_EXPIRATION_TIME - BotAction.delete_many_raw({'date': {'$lte': before_date}}) + BotAction.delete_many_raw({'platform': self.platform.value, 'date': {'$lte': before_date}}) async def send_bye(self, message: Message) -> multibot_constants.ORIGINAL_MESSAGE: return await self.send(random.choice((*constants.BYE_PHRASES, flanautils.CommonWords.random_time_greeting())), message)