{"_id":"@danielnguyen/node-red-contrib-telegrambot-home","_rev":"1-958ca838c94a062e2e2b434f8f14f72f","name":"@danielnguyen/node-red-contrib-telegrambot-home","dist-tags":{"latest":"0.5.3"},"versions":{"0.5.3":{"name":"@danielnguyen/node-red-contrib-telegrambot-home","version":"0.5.3","description":"Useful nodes for connecting your home to Telegram","node-red":{"nodes":{"bot":"nodes/bot-config/bot-config.js","command":"nodes/command/command.js","switch":"nodes/switch/switch.js","notify":"nodes/notify/notify.js","payload":"nodes/payload/payload.js"}},"repository":{"type":"git","url":"git+https://github.com/danielnguyen/node-red-contrib-telegrambot-home.git"},"keywords":["node-red","telegram","bot"],"scripts":{"dev":"npm run docker:up","docker:up":"npm run docker -- up --abort-on-container-exit --remove-orphans","docker:down":"npm run docker -- down","docker:restart":"npm run docker -- restart","docker:logs":"npm run docker -- logs -f && true","docker":"docker-compose -f docker-compose.yml"},"author":{"name":"Stephen Craton"},"license":"MIT","bugs":{"url":"https://github.com/danielnguyen/node-red-contrib-telegrambot-home/issues"},"homepage":"https://github.com/danielnguyen/node-red-contrib-telegrambot-home#readme","dependencies":{"node-telegram-bot-api":"^0.30.0"},"gitHead":"bb5e353e9b75be16754afae190f1b5ebccf9dfc4","_id":"@danielnguyen/node-red-contrib-telegrambot-home@0.5.3","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ldvQU1UiqdnDyloKTmy5e55GdUAbByB5VJhtuxRITcK81NMfUCHGatL6dCjEnXlJ9dPBd5qD8vlWV06M/iHp6w==","shasum":"5048546f86612f021ebe0e7d742168cf7fc3a23b","tarball":"https://registry.npmjs.org/@danielnguyen/node-red-contrib-telegrambot-home/-/node-red-contrib-telegrambot-home-0.5.3.tgz","fileCount":30,"unpackedSize":1229598,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZA/5CRA9TVsSAnZWagAAJ7cP/3TbMBZiTfuZ1/9bQfsO\nANtUAKXMQ4MYZ1RhI/BWeQGJz72rKMnCi2tH8KBm/cyn59rPWutI/842BDQW\nlkgfrFITc5Wk+zzMLL76b0J0V+oOk+otVkFv/9xmtnx291TstOJlelXVD9K2\nmEo9Lw01qlww42ET+QuXtUUSW2kzbG8jea3il9lagxNJ0YNTK2YWpQvrQbD9\nFsjRlIkfpTuqfNJxJd3Lp4JsYbYRJ5ncz8XBN8iqb1TRd6zufeFhgOU1mkLZ\nO2vnuqyOBuZfDLj985GQemtZtrY0TfbY9VPaZzeY6NUlm0ma6pfT7hsYzZ40\nDAi7lEyH4CM4/yrdlP2OPuPlGiYjz06aDW+YiDQlp3XIQXlt9tVJeOgnmv/Y\nqQSZa93rNjxl1/dxjeNkg5lnN7bO/Z17cbnon53fRkyjKEUVQSkBss/4lJkI\n20qykJ5A2GcxW4J9k6RfgJQ/6CJWdHXgITmYho7mTPGFGiTpM/9lUEV2EiHG\nEJIl5Ij9syW+JTMPjOSgBQmGEVuTo/VEkBDU19NsIt0C5izKGXeBdZ/SdUtb\nCLoSOQuyrQiE0Wd2joCZjAfJAeVf0ln9plMzETrK2EtS7Y6bmHgikfru+Kwf\nWKrS0kHNZOF7AUfs7IvhNkFni3sez6HP4fLRQnlB3UWYn0v/vt/dPjUnTPBO\nVFKN\r\n=Y3I3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBe8Ul4ABEyZ9969VAxIbpr0uN0awYS1vHRyIVtHhgY4AiEA0Zn3rdVJRAcLgOX30CV6GQekHdDXdj2sQrQ6hY53oi0="}]},"_npmUser":{"name":"danielnguyen-user","email":"daniel.nguyenhuu@gmail.com"},"directories":{},"maintainers":[{"name":"danielnguyen-user","email":"daniel.nguyenhuu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-red-contrib-telegrambot-home_0.5.3_1617170425281_0.3134747418132411"},"_hasShrinkwrap":false}},"time":{"created":"2021-03-31T06:00:25.037Z","0.5.3":"2021-03-31T06:00:25.518Z","modified":"2022-04-05T02:41:15.794Z"},"maintainers":[{"name":"danielnguyen-user","email":"daniel.nguyenhuu@gmail.com"}],"description":"Useful nodes for connecting your home to Telegram","homepage":"https://github.com/danielnguyen/node-red-contrib-telegrambot-home#readme","keywords":["node-red","telegram","bot"],"repository":{"type":"git","url":"git+https://github.com/danielnguyen/node-red-contrib-telegrambot-home.git"},"author":{"name":"Stephen Craton"},"bugs":{"url":"https://github.com/danielnguyen/node-red-contrib-telegrambot-home/issues"},"license":"MIT","readme":"node-red-contrib-telegrambot-home\n=====================================\n\nFork of [scraton/node-red-contrib-telegrambot-home](https://github.com/scraton/node-red-contrib-telegrambot-home) as it is mostly inactive.\n\nUseful nodes for connecting your home to Telegram.\n\n## Getting Started\n\nThis assumes you have [node-red](http://nodered.org/) already installed and working.\n\n```bash\ncd ~/.node-red\nnpm install node-red-contrib-telegrambot-home\nsudo service nodered restart\n```\n\n## Telegram Bot Setup\n\nYou will need to setup a Telegram bot in order to use these nodes. You can follow [these instructions](https://core.telegram.org/bots#6-botfather) for how to do it. In summary:\n\n1. **Create the bot:** Send BotFather the message `/newbot`\n1. **Name the bot:** Give it any name. This is how you will see it in Telegram.\n1. **Give the bot a username:** Must be unique. Doesn't have to match the bot's name.\n1. **Grab the token:** You will need this for configuring the nodes.\n1. **Send the bot a message:** Just say hi or click the start button in the chat window.\n1. **Grab the chat ID:** `curl \"https://api.telegram.org/bot${TOKEN}/getUpdates\"` replacing `${TOKEN}` with your bot token.\n\nYou will get a JSON response like the following:\n\n```json\n{\"ok\":true,\"result\":[{\"update_id\":123456,\n\"message\":{\"message_id\":1,\"from\":{\"id\":123,\"is_bot\":false,\"first_name\":\"Your\",\"last_name\":\"Name\",\"language_code\":\"en-US\"},\"chat\":{\"id\":987654321,\"first_name\":\"Your\",\"last_name\":\"Name\",\"type\":\"private\"},\"date\":12345678,\"text\":\"/start\"}}]}\n```\n\nIn this example, the chat ID is `987654321`.\n\nIf you get an empty response, try sending the bot another message. If it's still empty, make sure the bot is not in use by another application (or node) as it will consume the message before you can grab the ID.\n\nIf you wish to send messages to multiple chats, you will need to repeat the steps for grabbing each individual chat ID. Sending messages to a group has not been tested, but should be similar to the above steps.\n\nYou can then use the token and chat ID to configure the nodes.\n\n## Included Nodes\n\nYou can view detailed documentation for the nodes via the node-red info pane. Just select a node and start readin'.\n\n* [switch](#switch)\n* [notify](#notify)\n* [payload](#payload)\n* [command](#command)\n\n### switch\n\nRoute messages based on a response from a user via Telegram\n\n![](images/TelegramSwitchFlow.png?raw=true \"Switch Flow\")\n![](images/TelegramSwitchBotMessage.png?raw=true \"Telegram Message\")\n\n### notify\n\nSend a notification to a user via Telegram\n\n![](images/TelegramNotifyFlow.png?raw=true \"Notify Flow\")\n![](images/TelegramNotifyBotMessage.png?raw=true \"Telegram Message\")\n\n### payload\n\nSend an arbitrary payload via any available method to a user via Telegram\n\nAll of the [Telegram API methods](https://core.telegram.org/bots/api#available-methods) are available to you, either through the node properties or via dynamic payload generation.\n\n#### Static\n\n![](images/TelegramStaticPayloadFlow.png?raw=true \"Static Payload Flow\")\n![](images/TelegramStaticPayloadNode.png?raw=true \"Static Payload Node Properties\")\n![](images/TelegramStaticPayloadBotMessage.png?raw=true \"Telegram Message\")\n\n#### Dynamic\n\n![](images/TelegramDynamicPayloadFlow.png?raw=true \"Dynamic Payload Flow\")\n![](images/TelegramDynamicPayloadNode.png?raw=true \"Dynamic Payload Function\")\n![](images/TelegramDynamicPayloadBotMessage.png?raw=true \"Telegram Message\")\n\n### command\n\nInitiate a flow based on a command said in the chat\n\n![](images/TelegramCommandFlow.png?raw=true \"Command Flow\")\n![](images/TelegramCommandBotMessage.png?raw=true \"Telegram Message\")\n\nCommand nodes can also be configured for multi-chat flows. All other nodes are compatible and will route the message to the originating chat automatically. Simply leave the chat ID blank on the other nodes to enable this feature (and ensure the other chat IDs are authorized).\n\n---\n## Development\n\nAn environment with node-red can be easily spun up using Docker and Docker Compose.\n\n1. Clone this repository:        `git clone https://github.com/scraton/node-red-contrib-telegrambot-home`\n1. Install node dependencies:    `cd node-red-contrib-telegrambot-home && yarn install`\n1. Start the docker environment: `yarn run dev`\n\n---\n## Credits\n\nGotta give credit where credit is due.\n\n* [node-red](https://github.com/node-red/node-red)\n* [node-red-contrib-home-assistant](https://github.com/AYapejian/node-red-contrib-home-assistant)\n* [node-red-contrib-telegrambot](https://github.com/windkh/node-red-contrib-telegrambot)\n* [node-telegram-bot-api](https://github.com/yagop/node-telegram-bot-api)\n","readmeFilename":"README.md"}