From 8b8845d6078a69932ba0432db3656a6043cdcc13 Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Thu, 2 Feb 2023 12:15:57 +0000 Subject: [PATCH] bot_token --- src/auto_archiver/archivers/telethon_archiver.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/auto_archiver/archivers/telethon_archiver.py b/src/auto_archiver/archivers/telethon_archiver.py index 50a0a08..88981ec 100644 --- a/src/auto_archiver/archivers/telethon_archiver.py +++ b/src/auto_archiver/archivers/telethon_archiver.py @@ -28,7 +28,7 @@ class TelethonArchiver(Archiver): return { "api_id": {"default": None, "help": "telegram API_ID value, go to https://my.telegram.org/apps"}, "api_hash": {"default": None, "help": "telegram API_HASH value, go to https://my.telegram.org/apps"}, - # "bot_token": {"default": None, "help": "optional, but allows access to more content such as large videos, talk to @botfather"}, + "bot_token": {"default": None, "help": "optional, but allows access to more content such as large videos, talk to @botfather"}, "session_file": {"default": "secrets/anon", "help": "optional, records the telegram login session for future usage, '.session' will be appended to the provided value."}, "join_channels": {"default": True, "help": "disables the initial setup with channel_invites config, useful if you have a lot and get stuck"}, "channel_invites": { @@ -112,7 +112,8 @@ class TelethonArchiver(Archiver): logger.debug(f"TELETHON STARTING {chat}, {post_id}") # NB: not using bot_token since then private channels cannot be archived: self.client.start(bot_token=self.bot_token) - with self.client.start(): + # with self.client.start(): + with self.client.start(bot_token=self.bot_token): try: post = self.client.get_messages(chat, ids=post_id) except ValueError as e: