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):
|
async def _on_ready(self):
|
||||||
await super()._on_ready()
|
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)
|
flanautils.do_every(multibot_constants.CHECK_OLD_DATABASE_MESSAGES_EVERY_SECONDS, self.check_old_database_actions)
|
||||||
for chat in Chat.find({
|
for chat in Chat.find({
|
||||||
'platform': self.platform.value,
|
'platform': self.platform.value,
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ class FlanaTeleBot(TelegramBot, FlanaBot):
|
|||||||
|
|
||||||
async def _on_ready(self):
|
async def _on_ready(self):
|
||||||
await super()._on_ready()
|
await super()._on_ready()
|
||||||
|
if not self._is_initialized:
|
||||||
await self._update_whitelist()
|
await self._update_whitelist()
|
||||||
|
|
||||||
# -------------------------------------------------------- #
|
# -------------------------------------------------------- #
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ class PenaltyBot(MultiBot, ABC):
|
|||||||
|
|
||||||
async def _on_ready(self):
|
async def _on_ready(self):
|
||||||
await super()._on_ready()
|
await super()._on_ready()
|
||||||
|
if not self._is_initialized:
|
||||||
flanautils.do_every(constants.CHECK_PUNISHMENTS_EVERY_SECONDS, self.check_old_punishments)
|
flanautils.do_every(constants.CHECK_PUNISHMENTS_EVERY_SECONDS, self.check_old_punishments)
|
||||||
|
|
||||||
@bot_mentioned
|
@bot_mentioned
|
||||||
|
|||||||
Reference in New Issue
Block a user