Add telegram restart

This commit is contained in:
AlberLC
2024-05-17 15:57:24 +02:00
parent 86a1beed72
commit ebe87decf5
3 changed files with 7 additions and 2 deletions

View File

@@ -424,6 +424,9 @@ class FlanaBot(Connect4Bot, PenaltyBot, PollBot, ScraperBot, UberEatsBot, Weathe
async def _on_ready(self):
await super()._on_ready()
if self._is_initialized:
return
flanautils.do_every(multibot_constants.CHECK_OLD_DATABASE_MESSAGES_EVERY_SECONDS, self.check_old_database_actions)
for chat in Chat.find({
'platform': self.platform.value,

View File

@@ -84,7 +84,8 @@ class FlanaTeleBot(TelegramBot, FlanaBot):
async def _on_ready(self):
await super()._on_ready()
await self._update_whitelist()
if not self._is_initialized:
await self._update_whitelist()
# -------------------------------------------------------- #
# -------------------- PUBLIC METHODS -------------------- #

View File

@@ -123,7 +123,8 @@ class PenaltyBot(MultiBot, ABC):
async def _on_ready(self):
await super()._on_ready()
flanautils.do_every(constants.CHECK_PUNISHMENTS_EVERY_SECONDS, self.check_old_punishments)
if not self._is_initialized:
flanautils.do_every(constants.CHECK_PUNISHMENTS_EVERY_SECONDS, self.check_old_punishments)
@bot_mentioned
@group