Skip to content

flancer32/tg-bot-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

repo-tmpl-tg-bot

The base npm package for building Telegram bots using grammY and @teqfw/di.

Overview

This package enables the creation of Telegram bots using the grammY library.

It provides the following features:

  • Loading the bot's configuration (the API access token) from external sources (e.g., JSON file).
  • Running the Node.js application in two modes:
    • As a bot using long polling.
    • As a webhook server:
      • HTTP & HTTP/2 as an application server behind a proxy server.
      • HTTPS as a standalone server.
  • Common activity (setup of commands on startup, webhook registration, etc.)
  • Defining extension points where applications can add custom logic.

The Use Cases

Installation

Create the npm application and add the bot library to this app:

$ npm i @flancer32/repo-tmpl-tg-bot

Usage

$ ./bin/tequila.mjs help
$ ./bin/tequila.mjs tg-bot-start        # long polling mode
$ ./bin/tequila.mjs tg-bot-stop
$ ./bin/tequila.mjs web-server-start    # webhook mode
$ ./bin/tequila.mjs web-server-stop

Configuration

File ./cfg/local.json of the main app:

{
  "@flancer32/teq-telegram-bot": {
    "apiKeyTelegram": "..."
  }
}

API

  • Telegram_Bot_Back_Api_Setup: setup the grammY bot, add the commands and handlers.

About

A Telegram bot for registering users for events.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published