Getting Started
Installation 🚀
npm
Installation through Node Package Manager, NPM can be done as follows.
# through npm
$ npm i telegraf-cli -g
yarn
Installation through Yarn can be done as follows.
# through yarn
$ yarn add telegraf-cli -g
manual
The manual installation involves cloning the project github repository and building the source code(s) written in TypeScript into vanilla JavaScript using tsc, TypeScript Compiler.
# clone the repo
$ git clone https://github.com/0xridwanobafunso/telegraf-cli.git
# install TypeScript Compiler
$ npm i typescript -g
# install telegraf-cli dependencies
$ npm i
# build .ts source code(s) into .js source code(s)
$ npm run build
# the compiled .js code(s) and it types definitions lives in /dist directory.
# symlink the cli
$ npm link
# check if tcli or telegraf-cli commands available
$ tcli --version
Configuration
- For development: create dev.env file and paste the content inside example.dev.env into it.
- For production: create prod.env file and paste the content inside example.prod.env into it.
Open dev.env and prod.env and update your environments variables.
Example
# simply create your bot token using official Telegram bot called BotFather (https://t.me/BotFather)
BOT_TOKEN=GGSUSUygDISBE_qJ0xY6rwty7PJYPAQZPcD0U
# webhook
WEBHOOK=https://mybot-domain.com
# port
PORT=5000
⏮️ Introduction | Usage ⏭️