I want my user to input a telegram username in the form of @telegram_username, and get the telegram id of this user
username = args[0].strip()
chat = await context.bot.get_chat(username)
user = chat.id
but it throws me the “User not found” error
New contributor
user26179605 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.