Hi can't figure out how to solve this problem, so any help will be really appreciated. I'm subscribed to a private channel. This channel has no username and I don't have the invite link (the admin just added me). Since I use this channel at work, to speed up the things I want to process the messages posted on the channel using Telethon.
The core of the program is:
@events.register(events.NewMessage(chats = my_private_channel))
async def handler(event):
#do things
The problem is that I am not able to filter the messages coming to that specific channel id. I get the error:
ValueError: Cannot find any entity corresponding to "0123456789"
I have tried different technique to obtain my channel Id but the error is always the same. In particular:
- The channel is private so it has no username ("@blablabla")
- I have no invite link
- I have tried to process all incoming messages until the admin sent a message on the channel, print sender information and get the value from the "ID" key
- I have tried to use telegram web and get the ID from the url (also adding -100 in front of it)
But when I put the ID in the parameter chats, I get always the error reported above.
Thanks in advance, Have a nice day