Reputation: 105
yesterday at the evening everything worked but I tryied that same script at today's morning and I get this error output. I have this code for getting message.
async def get_mess():
limit = 1
global new
async for message in client.iter_messages('Passive Lifestyle Forex Signals', limit):
new = message.text
return message
ValueError: Cannot find any entity corresponding to "Passive Lifestyle Forex Signals"
Name of the channel is right, at the evening yesterday script was working and now it's not. I was checking telegram channel if they don't renamed it but it is same. I tried to reinstall telethon and delete session file. I tried it on different channels and non of that channels worked. Do you think you know where is the problem? If yes please let me know. I am usign latest telethon version. I'm using latest version of telethon.
Upvotes: 0
Views: 499
Reputation: 146
According to Documentation:
When something “entity-like” is required, it means that you need to provide something that can be turned into an entity. These things include, but are not limited to, usernames, exact titles, IDs, Peer objects, or even entire User, Chat and Channel objects and even phone numbers from people you have in your contact list.
Just pass your channel username passivelifestlyeforex
or the whole link t.me/passivelifestlyeforex
instead of exact title. The library will call the .resolve() method of the request, which will resolve 'username'. Once the library has “seen” the entity, you can use other "entity-like" variants.
async def get_mess():
limit = 1
global new
async for message in client.iter_messages('passivelifestlyeforex', limit):
new = message.text
return message
Upvotes: 3