Introduction: Telegram Bot With NodeMCU (ESP8266)

About: Technology is about helping to simplify human work. I am just a enthusiast of technology and I fell in love with the Internet of Things.

Need a bot to give notifications from your system? or do something just by sending a message? Telegram Bot is your solution!
In this tutorial, I will use Telegram Web and BotFather to make my bot.

Supplies

1. NodeMCU
2. Micro USB Cable
3. Telegram Web
Link: https://web.telegram.org/
4. ArduinoJson Library (version 5.13.5)
Download here: ArduinoJson Library
5. CTBot Library (version 1.4.1)
Download here: CTBot Library

Step 1: Create a Bot

I assume you have successfully logged into the web telegram. Do a few steps below and look at the picture above.
1. Type "botfather" in search box.
2. Select BotFather user
3. Tap the start button at the bottom of the screen
4. Type "/newbot" and send it
5. Type a name for your bot (e.g. Ardhi NodeMCU Bot)
6. Type a username for your bot (e.g. ardhi_nodemcu_bot)
7. Note or copy the token. The token will be used in the code.
8. Tap link of your bot (e.g. t.me/ardhi_nodemcu_bot)
9. Tap the start button at the bottom of the screen

Step 2: Code and Upload

1. Copy the code from here: Sketch
2. Paste it on the Arduino IDE
3. Change SSID, Password, and Token with yours
4. Plug the micro USB cable into NodeMCU
5. Plug the USB cable into your computer
6. Click the upload button and wait for it to finish

Step 3: Talk to Your Bot

Now your bot is ready. Try sending any text and enjoy conversations with your bot!