saeedNW / telegram-bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

telegram-bot


Requirements:

  • Ngrok
  • Node.js
  • Telegram bot token

Initialization

After you have ngrok installed and running. Create an env file like ".env.example" and replace the value of "SERVER_URL" with the URL received from ngrok (note that every time that you rerun ngrok you'll receives a new link)

After that open telegram and search for BotFather and create a new bot. replace the value of TOKEN in env file with the token received from BotFather


run bot

There are two ways to run this bot project, bot before that you need to install application dependencies

npm install
npm run dev:simpleApp # will run a simple bot which works directly with telegram APIs
npm run dev:telegraf # will run a bot which uses telegraf module to integrate with telegram webhooks

About


Languages

Language:JavaScript 94.7%Language:Shell 5.3%