In the telegram messenger every user, chat, and group is having a unique ID. So To prevent any unauthorized access to our telegram bots from other users we need to find our unique telegram chat ID and use it inside our code for ESP32 or ESP8266 or Raspberry Pi projects.
By doing so, every time we receive a message from the bot, it checks whether the ID corresponds with the ID pre-defined in the code, and then only if it matches, will it execute the commands. Follow the below steps to find your Used ID.
- In your Telegram account, search for “@myidbot” or open this link t.me/myidbot on your smartphone.
- Start a conversation with that bot and type /getid. You will get a reply back with your user ID.
- Note the user id as we’ll need it for our projects.