I am very new to Telethon and does not really know how it works or how to make it work. I have tried reading the documentations but do not understand most part of it.
I'm trying to print out messages from a particular group chat in Telegram, but when I run my piece of code, there is no output at all.
I am also not very sure on what to input for the parameters of TelegramClient and iter_messages.
Please help me out, much appreciated!
from telethon.sync import TelegramClient
api_id = '123'
api_hash = '123213'
with TelegramClient('name', api_id, api_hash) as client:
for message in client.iter_messages('me'):
print(message.sender_id, ':', message.text)
The
meinclient.iter_messages('me')gets the 'Saved Messages' group, you need to place a group-name there.For example, to show all the messages in the
FOOBARgroup, I'd do: