{"id":13461885,"url":"https://github.com/yagop/node-telegram-bot-api","last_synced_at":"2025-05-12T13:06:38.367Z","repository":{"id":37906188,"uuid":"38216778","full_name":"yagop/node-telegram-bot-api","owner":"yagop","description":"Telegram Bot API for NodeJS","archived":false,"fork":false,"pushed_at":"2025-04-16T23:04:59.000Z","size":2458,"stargazers_count":8768,"open_issues_count":126,"forks_count":1575,"subscribers_count":159,"default_branch":"master","last_synced_at":"2025-05-12T13:06:22.073Z","etag":null,"topics":["api","bot","bot-framework","chatbot","nodejs","telegram"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yagop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2015-06-28T22:35:33.000Z","updated_at":"2025-05-12T01:00:10.000Z","dependencies_parsed_at":"2023-02-12T21:45:34.677Z","dependency_job_id":"7a482217-38e1-4e0f-a403-de44a9386997","html_url":"https://github.com/yagop/node-telegram-bot-api","commit_stats":{"total_commits":537,"total_committers":87,"mean_commits":6.172413793103448,"dds":0.7057728119180633,"last_synced_commit":"6077f9ba103cb969753199f5a4fc92c78eef902c"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yagop%2Fnode-telegram-bot-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yagop%2Fnode-telegram-bot-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yagop%2Fnode-telegram-bot-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yagop%2Fnode-telegram-bot-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yagop","download_url":"https://codeload.github.com/yagop/node-telegram-bot-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745151,"owners_count":21957317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api","bot","bot-framework","chatbot","nodejs","telegram"],"created_at":"2024-07-31T12:00:26.382Z","updated_at":"2025-05-12T13:06:38.324Z","avatar_url":"https://github.com/yagop.png","language":"JavaScript","readme":"\u003ch1 align=\"center\"\u003eNode.js Telegram Bot API\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\nNode.js module to interact with the official [Telegram Bot API](https://core.telegram.org/bots/api).\n\n\n[![Bot API](https://img.shields.io/badge/Bot%20API-v.9.0-00aced.svg?style=flat-square\u0026logo=telegram)](https://core.telegram.org/bots/api)\n[![npm package](https://img.shields.io/npm/v/node-telegram-bot-api?logo=npm\u0026style=flat-square)](https://www.npmjs.org/package/node-telegram-bot-api)\n[![Coverage Status](https://img.shields.io/codecov/c/github/yagop/node-telegram-bot-api?style=flat-square\u0026logo=codecov)](https://codecov.io/gh/yagop/node-telegram-bot-api)\n\n[![https://telegram.me/node_telegram_bot_api](https://img.shields.io/badge/💬%20Telegram-Channel-blue.svg?style=flat-square)](https://telegram.me/node_telegram_bot_api)\n[![https://t.me/+_IC8j_b1wSFlZTVk](https://img.shields.io/badge/💬%20Telegram-Group-blue.svg?style=flat-square)](https://t.me/+_IC8j_b1wSFlZTVk)\n[![https://telegram.me/Yago_Perez](https://img.shields.io/badge/💬%20Telegram-Yago_Perez-blue.svg?style=flat-square)](https://telegram.me/Yago_Perez)\n\n\u003c/div\u003e\n\n## 📦 Install\n\n```sh\nnpm i node-telegram-bot-api\n```\n\n\u003cbr/\u003e\n\n\u003e ✍️ **Note:** If you use Typescript you can install this package that contains type definitions for this library\n\u003e```sh\n\u003enpm install --save-dev @types/node-telegram-bot-api\n\u003e```\n\n## 🚀 Usage\n\n```js\nconst TelegramBot = require('node-telegram-bot-api');\n\n// replace the value below with the Telegram token you receive from @BotFather\nconst token = 'YOUR_TELEGRAM_BOT_TOKEN';\n\n// Create a bot that uses 'polling' to fetch new updates\nconst bot = new TelegramBot(token, {polling: true});\n\n// Matches \"/echo [whatever]\"\nbot.onText(/\\/echo (.+)/, (msg, match) =\u003e {\n  // 'msg' is the received Message from Telegram\n  // 'match' is the result of executing the regexp above on the text content\n  // of the message\n\n  const chatId = msg.chat.id;\n  const resp = match[1]; // the captured \"whatever\"\n\n  // send back the matched \"whatever\" to the chat\n  bot.sendMessage(chatId, resp);\n});\n\n// Listen for any kind of message. There are different kinds of\n// messages.\nbot.on('message', (msg) =\u003e {\n  const chatId = msg.chat.id;\n\n  // send a message to the chat acknowledging receipt of their message\n  bot.sendMessage(chatId, 'Received your message');\n});\n```\n\n## 📚 Documentation\n\n* [Usage][usage]\n* [Examples][examples]\n* [Tutorials][tutorials]\n* [Help Information][help]\n* API Reference: ([api-release](../master/doc/api.md) / [development][api-dev] / [experimental][api-experimental])\n* [Contributing to the Project][contributing]\n* [Experimental Features][experimental]\n\n_**Note**: Development is done against the **development** branch.\nCode for the latest release resides on the **master** branch.\nExperimental features reside on the **experimental** branch._\n\n\n## 💭 Community\n\nWe thank all the developers in the Open-Source community who continuously\ntake their time and effort in advancing this project.\nSee our [list of contributors][contributors].\n\nWe have a [Telegram channel][tg-channel] where we post updates on\nthe Project. Head over and subscribe!\n\nWe also have a [Telegram  group][tg-group] to discuss issues related to this library.\n\nSome things built using this library that might interest you:\n\n* [tgfancy](https://github.com/GochoMugo/tgfancy): A fancy, higher-level wrapper for Telegram Bot API\n* [node-telegram-bot-api-middleware](https://github.com/idchlife/node-telegram-bot-api-middleware): Middleware for node-telegram-bot-api\n* [teleirc](https://github.com/FruitieX/teleirc): A simple Telegram ↔ IRC gateway\n* [bot-brother](https://github.com/SerjoPepper/bot-brother): Node.js library to help you easily create telegram bots\n* [redbot](https://github.com/guidone/node-red-contrib-chatbot): A Node-RED plugin to create telegram bots visually\n* [node-telegram-keyboard-wrapper](https://github.com/alexandercerutti/node-telegram-keyboard-wrapper): A wrapper to improve keyboards structures creation through a more easy-to-see way (supports Inline Keyboards, Reply Keyboard, Remove Keyboard and Force Reply)\n* [beetube-bot](https://github.com/kodjunkie/beetube-bot): A telegram bot for music, videos, movies, EDM tracks, torrent downloads, files and more.\n* [telegram-inline-calendar](https://github.com/VDS13/telegram-inline-calendar): Date and time picker and inline calendar for Node.js telegram bots.\n* [telegram-captcha](https://github.com/VDS13/telegram-captcha): Telegram bot to protect Telegram groups from automatic bots.\n\n\n## 👥 Contributors\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/yagop/node-telegram-bot-api/graphs/contributors\"\u003e\n    \u003cimg src=\"https://contrib.rocks/image?repo=yagop/node-telegram-bot-api\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## License\n\n**The MIT License (MIT)**\n\nCopyright © 2019 Yago\n\n[usage]:https://github.com/yagop/node-telegram-bot-api/tree/master/doc/usage.md\n[examples]:https://github.com/yagop/node-telegram-bot-api/tree/master/examples\n[help]:https://github.com/yagop/node-telegram-bot-api/tree/master/doc/help.md\n[tutorials]:https://github.com/yagop/node-telegram-bot-api/tree/master/doc/tutorials.md\n[api-dev]:https://github.com/yagop/node-telegram-bot-api/tree/master/doc/api.md\n[api-release]:https://github.com/yagop/node-telegram-bot-api/tree/release/doc/api.md\n[api-experimental]:https://github.com/yagop/node-telegram-bot-api/tree/experimental/doc/api.md\n[contributing]:https://github.com/yagop/node-telegram-bot-api/tree/master/CONTRIBUTING.md\n[contributors]:https://github.com/yagop/node-telegram-bot-api/graphs/contributors\n[experimental]:https://github.com/yagop/node-telegram-bot-api/tree/master/doc/experimental.md\n[tg-channel]:https://telegram.me/node_telegram_bot_api\n[tg-group]:https://t.me/+nc3A9Hs1S81mYzdk\n","funding_links":[],"categories":["Bot Libraries","JavaScript","后端开发框架及项目","Description","Telegram Libraries","Bots","Libraries","一般机器人（bots）"],"sub_categories":["管理面板","Node","Bot Libs","Node.js","Unofficial","Telegram","机器人类库"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyagop%2Fnode-telegram-bot-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyagop%2Fnode-telegram-bot-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyagop%2Fnode-telegram-bot-api/lists"}