is there a way to get the user id using the username?
Using the official Telegram Bot API, there is no clear way to do that. However, if the bot has an open chat with the user, you may use the getChatMember method.
Also, you may want to take a look at https://github.com/kamikazechaser/tg-resolve.
You may want to look at https://github.com/kamikazechaser/tg-resolve or
https://github.com/GochoMugo/tgfancy (Addon to node-telegram-bot-api by @GochoMugo which has tg-resolve included)
thank you guys It works but its very slow
to resolve a username I need to wait 3 minutes
@mnb3000 @GochoMugo
guys tg-resolve is not working, do you have some alternatives to it? I need it in my bot
This is a long shot but you could run your own instance of PWRTelegram. Some time back, we had an issue with load on the primary server.
Closing this issue as the original question has been answered. Feel free to continue with the discussion.
@abbddo tg-resolve isnt working, did you find a solution?
Most helpful comment
You may want to look at https://github.com/kamikazechaser/tg-resolve or
https://github.com/GochoMugo/tgfancy (Addon to node-telegram-bot-api by @GochoMugo which has tg-resolve included)