{"id":19425561,"url":"https://github.com/botmasterai/botmaster-telegram","last_synced_at":"2025-07-04T00:35:09.233Z","repository":{"id":71333368,"uuid":"83429332","full_name":"botmasterai/botmaster-telegram","owner":"botmasterai","description":"The Telegram Botmaster integration","archived":false,"fork":false,"pushed_at":"2018-10-30T11:00:29.000Z","size":85,"stargazers_count":4,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-29T20:07:43.450Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/botmasterai.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":"2017-02-28T12:24:30.000Z","updated_at":"2021-09-15T09:14:59.000Z","dependencies_parsed_at":"2023-07-16T05:31:38.102Z","dependency_job_id":null,"html_url":"https://github.com/botmasterai/botmaster-telegram","commit_stats":{"total_commits":15,"total_committers":4,"mean_commits":3.75,"dds":0.4666666666666667,"last_synced_commit":"590d0ba1ebc3fcca307477409ff5616f81874c80"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/botmasterai/botmaster-telegram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botmasterai%2Fbotmaster-telegram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botmasterai%2Fbotmaster-telegram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botmasterai%2Fbotmaster-telegram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botmasterai%2Fbotmaster-telegram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/botmasterai","download_url":"https://codeload.github.com/botmasterai/botmaster-telegram/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botmasterai%2Fbotmaster-telegram/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259698511,"owners_count":22898089,"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":[],"created_at":"2024-11-10T14:04:06.391Z","updated_at":"2025-07-04T00:35:09.202Z","avatar_url":"https://github.com/botmasterai.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Botmaster-telegram\n\n[![Build Status](https://travis-ci.org/botmasterai/botmaster-telegram.svg?branch=master)](https://travis-ci.org/botmasterai/botmaster-telegram)\n\u003c!--[![Coverage Status](https://coveralls.io/repos/github/botmasterai/botmaster-telegram/badge.svg?branch=master)](https://coveralls.io/github/botmasterai/botmaster-telegram?branch=master)--\u003e\n[![npm-version](https://img.shields.io/npm/v/botmaster-telegram.svg)](https://www.npmjs.com/package/botmaster-telegram)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](LICENSE)\n\nThis is the Telegram integration for botmaster. It allows you to use your \nbotmaster bot on Telegram.\n\nThis package works with botmaster v3;\n---\n\nBotmaster is a lightweight chatbot framework. Its purpose is to integrate your existing chatbot into a variety of messaging channels.\n\n## Documentation\n\nFind the whole documentation for the framework on: http://botmasterai.com/documentation.latest\n\n## Installing\n\n```bash\nyarn add botmaster-telegram\n```\n\nor\n\n```bash\nnpm install --save botmaster-telegram\n```\n\n## Credentials\n\nAll you need here is an authToken. In order to get one, you will need to either create a new bot on telegram.\n\nBasically, you'll need to send a `/newbot` command(message) to Botfather (go talk to him [here](https://web.telegram.org/#/im?p=@BotFather)). Once you're done with giving it a name and a username, BotFather will come back to you with your authToken. Make sure to store it somewhere. More info on BotFather can be found [here](https://core.telegram.org/bots#create-a-new-bot ) if needed.\n\nFor more on Telegram, you can find the telegram api docs [here](https://core.telegram.org/bots/api)\n\n## Webhooks\n\nSetting up your webhook requires you to make the following request outside of Botmaster (using curl for instance or a browser):\n\n\n```http\nhttps://api.telegram.org/bot\u003cauthToken\u003e/setWebhook?url=\u003c'Your Base URL'\u003e/telegram/webhook1234\n```\n\n\u003eBecause Telegram doesn't send any type of information to verify the identity of the origin of the update, it is highly recommended that you include a sort of hash in your webhookEndpoint. I.e., rather than having this: `webhookEndpoint: '/webhook/'`, do something more like this: `webhookEndpoint: '/webhook92ywrnc9qm4qoiuthecvasdf42FG/'`. This will assure that you know where the request is coming from.\n\n\n\u003eIf you are not too sure how webhooks work and/or how to get them to run locally, go to [webhooks](/getting-started/webhooks) to read some more.\n\n## Code\n\n```js\nconst Botmaster = require('botmaster');\nconst TelegramBot = require('botmaster-telegram');\nconst botmaster = new Botmaster();\n\nconst telegramSettings = {\n  credentials: {\n    authToken: 'YOUR authToken',\n  },\n  webhookEndpoint: '/webhook1234/',\n};\n\nconst telegramBot = new TelegramBot(telegramSettings);\nbotmaster.addBot(telegramBot);\n\nbotmaster.use({\n  type: 'incoming',\n  name: 'my-middleware',\n  controller: (bot, update) =\u003e {\n    return bot.reply(update, 'Hello world!');\n  }\n});\n```\n\n#### Note on attachment types and conversions\n\nAttachment type conversion works as such for __Telegram__:\n\n| Telegram Type | Botmaster conversion\n|--- |---\n| audio | audio\n| voice  | audio\n| photo  | image\n| video  | video\n| location  | location\n| venue  | location\n\n`contact` attachment types aren't supported in Messenger. So in order to deal with them in Botmaster, you will have to look into your `update.raw` object which is the standard Telegram update. You will find your contact object in `update.raw.contact`.\n\nAlso, concerning `location` and `venue` attachments. The url received in Botmaster for Telegram is a google maps one with the coordinates as query parameters. It looks something like this: `https://maps.google.com/?q=\u003clat\u003e,\u003clong\u003e`\n\nA few of you will want to use attachments with your `socket.io` bots. Because the Botmaster message standard is the Facebook Messenger one, everything is URL based. Which means it is left to the developer to store both incoming and outgoing attachments.\n\n## License\n\nThis library is licensed under the MIT [license](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotmasterai%2Fbotmaster-telegram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbotmasterai%2Fbotmaster-telegram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotmasterai%2Fbotmaster-telegram/lists"}