Hi I am trying to build a website login system where users are able to log in using their telegram. I would like to achieve this workflow:
- User selects to login/sign up via telegram.
- User enters their username (@ExampleJoe).
- A 6-digit verification code is sent to them via my Telegram bot (@ExampleBot).
- The user enters the received 6-digit code into my website and is allowed to enter.
I have issues with steps 2-3 where my bot can send them a direct message (not in a group chat) with only their username. I am aware that sendMessage method in the Telegram bot API requires a chat_id and that a user_id is also suitable. However, I do not know how to get the user_id with just the user's username.