File "G:\python311\Lib\site-packages\telethon\client\downloads.py", line 438, in download_media
return await self._download_document(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\python311\Lib\site-packages\telethon\client\downloads.py", line 929, in _download_document
result = await self._download_file(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\python311\Lib\site-packages\telethon\client\downloads.py", line 584, in _download_file
return await self._download_file(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\python311\Lib\site-packages\telethon\client\downloads.py", line 563, in _download_file
async for chunk in self._iter_download(
File "G:\python311\Lib\site-packages\telethon\requestiter.py", line 58, in __anext__
if await self._init(**self.kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\python311\Lib\site-packages\telethon\client\downloads.py", line 45, in _init
self._client = await self.client._get_cdn_client(cdn_redirect)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\python311\Lib\site-packages\telethon\client\telegrambaseclient.py", line 899, in _get_cdn_client
dc = await self._get_dc(cdn_redirect.dc_id, cdn=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\python311\Lib\site-packages\telethon\client\telegrambaseclient.py", line 809, in _get_dc
raise ValueError(f'Failed to get DC {dc_id} (cdn = {cdn})')
ValueError: Failed to get DC 203 (cdn = True)
I don't understand why I can successfully download this file through portable, but not through Teleton
in my research i can take file_token, any ideas how to get file if i have cd and file_token?
Читать полностью…Hi and welcome to the group. Before asking any questions, please read the rules from the group's description, and don't forget to read the docs. Make sure you are using the latest version with pip3 install -U telethon
, since most problems have already been fixed in newer versions.
you can't send MessageEntityMentionName. you must send InputMessageEntityMentionName, or whatever it was called.
i cannot remember what part of v1 modifies urls-that-look-like-mentions for actual mentions
why wouldn't they, bots are likely to have more reliable updates than users. especially in channels/supergroups
Читать полностью…if you receive no event, Telegram sent no event. don't use a userbot and switch to bot
Читать полностью…Hello
I wan't delete this service message via client. I checked in multiple channels and sometimes, I didn't get event's update.
My code:
Читать полностью…
import telethon
client = TelegramClient('s', api_id, api_hash)
@client.on(telethon.events.Raw)
async def my_event_handler(event):
if isinstance(event, telethon.types.UpdateNewChannelMessage):
if isinstance(event.message, telethon.types.MessageService):
if isinstance(event.message.action, telethon.types.MessageActionPinMessage):
await client.delete_messages(event.message.chat_id, event.message.id)
async def main():
await client.start()
while True:
await asyncio.sleep(1)
if __name__ == '__main__':
asyncio.run(main())
yes that’s working thank you i tested than in previous version but seems working on this version
Читать полностью…it's not optional argument in tl. the representation is off in this
you mostly pass default values like option=b''
its not problem
the problem is telegram changed report options completely and its no longer like before
in first request in telegram logs it sends empty option and message and in return gets all options
no its not check latest version it dosent need reason
messages.report(peer: inputPeerChannel(channelId: 1, accessHash: -1), id: [6767], option: <null>, message: )]