Add support for Telethon's catch_up() (ref #124)

This commit is contained in:
Tulir Asokan
2018-05-13 11:22:20 +03:00
parent fd763b953d
commit 79341b8d28
5 changed files with 13 additions and 1 deletions
+6
View File
@@ -86,6 +86,12 @@ class Bot(AbstractUser):
except (ChannelPrivateError, ChannelInvalidError):
self.remove_chat(id.channel_id)
if config["bridge.catch_up"]:
try:
await self.client.catch_up()
except Exception:
self.log.exception("Failed to run catch_up() for bot")
def register_portal(self, portal: po.Portal):
self.add_chat(portal.tgid, portal.peer_type)