{"id":29196576,"url":"https://github.com/flancer32/teq-telegram-bot","last_synced_at":"2026-06-20T23:31:11.706Z","repository":{"id":253827536,"uuid":"844570366","full_name":"flancer32/teq-telegram-bot","owner":"flancer32","description":"TeqFW plugin to build Telegram bots","archived":false,"fork":false,"pushed_at":"2024-11-04T18:08:48.000Z","size":111,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-03T05:17:43.020Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flancer32.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-19T14:25:03.000Z","updated_at":"2024-12-30T01:45:02.000Z","dependencies_parsed_at":"2024-10-26T13:10:58.091Z","dependency_job_id":null,"html_url":"https://github.com/flancer32/teq-telegram-bot","commit_stats":null,"previous_names":["flancer32/teq-telegram-bot"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/flancer32/teq-telegram-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flancer32%2Fteq-telegram-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flancer32%2Fteq-telegram-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flancer32%2Fteq-telegram-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flancer32%2Fteq-telegram-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flancer32","download_url":"https://codeload.github.com/flancer32/teq-telegram-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flancer32%2Fteq-telegram-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34589204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-02T06:07:36.003Z","updated_at":"2026-06-20T23:31:11.701Z","avatar_url":"https://github.com/flancer32.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# @flancer32/teq-telegram-bot\n\nA foundational npm package for building Telegram bots using [grammY](https://grammy.dev/)\nand [@teqfw/di](https://github.com/teqfw/di).\n\n## Overview\n\nThis package facilitates the creation of Telegram bots leveraging the grammY\nlibrary ([Habr post](https://habr.com/ru/articles/837610/) in Russian). Key features include:\n\n- Loading bot configuration (e.g., token) from external sources like a JSON file.\n- Supporting two operational modes:\n    - **Bot mode**: Uses long polling.\n    - **Webhook server mode**:\n        - Operates over HTTP/HTTP2 behind a proxy.\n        - Supports HTTPS as a standalone server.\n- Common setup tasks (e.g., registering commands at startup, setting up webhooks).\n- Extension points to add custom application logic.\n\n![Use Cases](./doc/img/lib.uc.png)\n\n## Installation\n\nTo integrate the bot library in an npm application:\n\n```shell\nnpm i @flancer32/teq-telegram-bot\n```\n\n## Usage\n\nThe package includes several commands for managing bot modes and server operations:\n\n```shell\n./bin/tequila.mjs help\n./bin/tequila.mjs tg-bot-start         # Start in long polling mode\n./bin/tequila.mjs tg-bot-stop\n./bin/tequila.mjs web-server-start     # Start in webhook mode\n./bin/tequila.mjs web-server-stop\n```\n\n## Configuration\n\nConfigure the main application with a `local.json` file in the `./cfg` directory:\n\n```json\n{\n  \"@flancer32/teq-telegram-bot\": {\n    \"apiKeyTelegram\": \"YOUR_TELEGRAM_API_KEY\",\n    \"webhookSecret\": \"YOUR_OPTIONAL_WEBHOOK_SECRET\"\n  }\n}\n```\n\n- **apiKeyTelegram**: Your Telegram Bot API key, required to authenticate the bot with Telegram servers.\n- **webhookSecret** (optional): A secret token to secure webhook requests. If not provided, a random one-time token will be generated by the application on startup.\n\n## API\n\nTo implement custom bot logic, create a class that follows the `Telegram_Bot_Back_Api_Setup` interface. This class\nshould initialize the grammY bot, set up middleware, and define bot commands and handlers.\n\n### Setup Replacement in `@teqfw/di`\n\nSpecify the custom setup class in the `./teqfw/json` configuration file to override the default bot setup:\n\n```json\n{\n  \"@teqfw/di\": {\n    \"autoload\": {},\n    \"replaces\": {\n      \"back\": {\n        \"Telegram_Bot_Back_Api_Setup\": \"YourApp_Back_Bot_Setup\"\n      }\n    }\n  }\n}\n```\n\nReplace `\"YourApp_Back_Bot_Setup\"` with the fully qualified name of your custom setup class.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflancer32%2Fteq-telegram-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflancer32%2Fteq-telegram-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflancer32%2Fteq-telegram-bot/lists"}