LonamiWebs / Telethon

Pure Python 3 MTProto API Telegram client library, for bots too!
https://docs.telethon.dev
MIT License
10.02k stars 1.41k forks source link

Can't get User id... #4422

Closed ultimakaz closed 3 months ago

ultimakaz commented 3 months ago

Code that causes the issue

async def get_user_entity(user_id): try: return await client.get_input_entity(user_id) except Exception as e: print(f"Error retrieving user entity for ID {user_id}: {e}") return None

Expected behavior

This code worked well last week, but now i can't get user's id, what;s wrong? What can i do?

Actual behavior

It's just gives an error

Traceback

No response

Telethon version

Version: 1.34.0

Python version

3.12.0

Operating system (including distribution name and version)

windows server 2018

Other details

No response

Checklist

Lonami commented 3 months ago

Entity must be in cache. If it's not, Telethon can't fetch it.