Add telegram restart
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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 -------------------- #
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user