Rattlyy / NodeTGBot

Simple Node Telegram Bot base

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NodeTGBot Bot API Version Version

Simple Node Telegram Bot base -- NOW SUPPORTING KEYBOARDS

Tutorial

Installation

WHAT IS A SECRET:

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.

Easy Way: Remix on Glitch

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

Difficult Way:

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

How to use it

Read the example commands + telegram api wrapper docs

How does it works

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.

Support

@Rattly