

Please share it on twitter 🐦 or other social media platforms. If you got value from this, and/or if you think this can be improved, please let me know in the comments.

If you enjoyed this tutorial, please give it some praise with some claps and share this tutorial, it would greatly be appreciated.Īlso, let me know if you want to see more articles about this and how I can take this further. Setting up payments with the bot to accept money (only works on mobile).Adding bots to groups to moderate text and issue warnings or actions.Add custom keyboard actions and commands to expedited requests Correctness & Testing This project is fully tested using Unit tests and Systems Integration tests before each release.There are a few other things we can do to go from here and take things to the next level: You have successfully setup a bot for local development which filters messages and replies back. Notice our bot replying back when the word “hello” is present in our message.Īnd there you have it. Save the file and re-run the NodeJS application and go back to Telegram. Index.js // Dependencies const express = require('express') const app = express() const axios = require('axios') const bodyParser = require('body-parser') const port = 80 const url = ' ' const apiToken = ') Example - First Chat Bot On the previous page we got an access token and used the getMe method to check our setup. In our file, configure a simple output to return the data and just console log the payload in Terminal. # configure as needed npm init # install dependencies npm i express axios body-parser -save # create main file touch index.js In a new project directory, we’ll need to initiate NodeJS. Building NodeJS APIįor this we’ll need to create our first NodeJS application.

Now that we’ve established a connection, let’s create our first endpoint that will accept this a message and reply back.
