Oct-12-2021, 05:09 PM
hi at all , i have a little problem , sorry at al i am beginner of python and telegram and telethon sorry , i want read all message in one channel (i am user), and publish in my channel (admin ), i create this srcipt , and it work for message but not work for download foto , (my platform is linux mint)
anyone can help me ?? or giveme some suggestion ?? thanks
anyone can help me ?? or giveme some suggestion ?? thanks
#from telethon import TelegramClient from telethon import TelegramClient, events import logging name = "TESTCHANNEL" api_id = "000000" api_hash = "AJAJAJJAJAJAJAJAJAJAJAJ" phone = "+32000000000" Nik = "NIKNAME" filename = "foto" # Remember to use your own values from my.telegram.org! logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s', level=logging.WARNING) client = TelegramClient('session', api_id, api_hash) client.start() channel = name @client.on(events.NewMessage(chats=channel)) async def handler(event): print(event.message.message) MessageR=(event.message.message) mes = await client.send_message(Nik,MessageR) await client.pin_message(Nik, mes, notify=True) path = await client.download_media(message) await client.download_media(message, filename) client.run_until_disconnected()thanks at all