Telegram Bot With NodeMCU (ESP8266)

by ardhiwahyudhi in Circuits > Arduino

4685 Views, 1 Favorites, 0 Comments

Telegram Bot With NodeMCU (ESP8266)

banner.png

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

Create a Bot

create new bot.png
create new bot1.png
create new bot2.png

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

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

Talk to Your Bot

talk to bot.png

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