From 113dee6bd852efe96636168c5bf772fdb0ac0395 Mon Sep 17 00:00:00 2001 From: AlberLC Date: Wed, 30 Nov 2022 01:11:03 +0100 Subject: [PATCH] Use delete_many_raw --- flanabot/bots/flana_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flanabot/bots/flana_bot.py b/flanabot/bots/flana_bot.py index a12686e..a39e726 100644 --- a/flanabot/bots/flana_bot.py +++ b/flanabot/bots/flana_bot.py @@ -332,7 +332,7 @@ class FlanaBot(Connect4Bot, PenaltyBot, PollBot, ScraperBot, WeatherBot, MultiBo async def clear_old_database_items(cls): await super().clear_old_database_items() before_date = datetime.datetime.now(datetime.timezone.utc) - multibot_constants.MESSAGE_EXPIRATION_TIME - BotAction.collection.delete_many({'date': {'$lte': before_date}}) + BotAction.delete_many_raw({'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)