Simple Node Telegram Bot base -- NOW SUPPORTING KEYBOARDS
A secret is a random string that needs to be set in your server.js file, also, it needs to be passed in the webhook in the SECRET field.
Why? Because if you don't pass this secret someone can send fake updates to the bot, making the code thinks that we're doing stuff but we're not.
Set the webhook to the link of glitch + /webhook and set the token in .env
Webhook template: https://api.telegram.org/botYOURTOKEN/setWebhook?url=HTTPS site url/webhook/SECRET
git clone https://github.com/zRattly/NodeTGBot.git
npm i --s
node server.js
Set the webhook to the link + /webhook and set the token in .env
Webhook template: https://api.telegram.org/botYOURTOKEN/setWebhook?url=HTTPS site url/webhook/SECRET
Read the example commands + telegram api wrapper docs
The Express webserver gets the update and the "Handler" class process it.
A small script is inserted for handling updates better and having a cleaner code.