Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
node-red-contrib-telegrambot-home
Advanced tools
Readme
Useful nodes for connecting your home to Telegram.
This assumes you have node-red already installed and working.
cd ~/.node-red
npm install node-red-contrib-telegrambot-home
sudo service nodered restart
You will need to setup a Telegram bot in order to use these nodes. You can follow these instructions for how to do it. In summary:
/newbot
curl "https://api.telegram.org/bot${TOKEN}/getUpdates"
replacing ${TOKEN}
with your bot token.You will get a JSON response like the following:
{"ok":true,"result":[{"update_id":123456,
"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"}}]}
In this example, the chat ID is 987654321
.
If 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.
If 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.
You can then use the token and chat ID to configure the nodes.
You can view detailed documentation for the nodes via the node-red info pane. Just select a node and start readin'.
Route messages based on a response from a user via Telegram
Send a notification to a user via Telegram
Send an arbitrary payload via any available method to a user via Telegram
All of the Telegram API methods are available to you, either through the node properties or via dynamic payload generation.
Initiate a flow based on a command said in the chat
Command 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).
An environment with node-red can be easily spun up using Docker and Docker Compose.
git clone https://github.com/scraton/node-red-contrib-telegrambot-home
cd node-red-contrib-telegrambot-home && yarn install
yarn run dev
Gotta give credit where credit is due.
FAQs
Useful nodes for connecting your home to Telegram
The npm package node-red-contrib-telegrambot-home receives a total of 119 weekly downloads. As such, node-red-contrib-telegrambot-home popularity was classified as not popular.
We found that node-red-contrib-telegrambot-home demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.