How to set timeout between requests to Telegram servers?
I need to set timeout before every send_messages function
AttributeError: module ‘telethon.tl.functions.messages’ has no attribute ‘GetAllChatsRequest’
I’m encountering an issue while trying to extract all chat IDs from a group and channel using Telethon. Here’s the code snippet I’m using:
telethon to forward telegram messages error
I’m trying to get messages from test_channel_1
and forward them to out_channel
to no avail.
I get the error message
Stream Telethon media download to upload POST endpoint
I am trying to write a script in Python that downloads some media file from a channel and then uploads it to another location using a POST endpoint.
I am using the Telethon library to download said media file from Telegram. The issue I currently have is that, the file size is about 1Gb in size, and I’d like to stream the download directly to the upload instead of storing it in memory or in file. As far as I am aware, Telethon only allows you to download into memory or into a file.
This is the code I’m currently working with.
how do I read messages in open groups? telethon
from telethon.sync import TelegramClient api_id = ‘?????’ api_hash = ‘????????’ with TelegramClient(‘sync’, api_id, api_hash) as client: chat_entity = client.get_entity(‘https://t.me/new_ton_news’) for message in client.iter_messages(chat_entity): print(message.sender_id, ‘:’, message.text) telethon.errors.rpcerrorlist.BotMethodInvalidError: The API access for bot users is restricted. The method you tried to invoke cannot be executed as a bot (caused by GetHistoryRequest) python telegram telethon New contributor […]