I have prepared a simple unix bash script for monitoring the UNS.network NODES via Telegram messenger.
I will give some basic information about how to create Telegram Bot in this message. If you are already familiar with Telegram Bots you could skip this message and read my second message.
How to Create Telegram Bot
For creating new BOT you need to contact the BotFather, which is essentially a bot used to create other bots.
Type botfather in Telegram search box and select BotFather from list.
Choose a name for your bot. I have choosen UNIKNAME as an example.
Select an username for your bot as described in the bot message.
Note the token to access the HTTP API. We will use it in the script file.
Type your new bot name into the search box and select it from the list.
Press a few times to START button…
We have completed the Telegram Bot creation at this step. We will use the following commands from unix shell in order to get CHAT ID of the BOT.
# install jq sudo apt-get install jq -y
install jq command if it is not already installed.
# Set TOKEN variable TOKEN=999999999:AAAAAAAAAAA-aaa-AAAAAAAAAAAAAAAAAAA111111
You must use your own TOKEN created above by BotFather…
# Get CHAT_ID curl -s https://api.telegram.org/bot$TOKEN/getUpdates | jq .result.message.chat.id
The output of above command will produce CHAT_ID. ( i.e. 999999443333) Note the CHAT_ID produced. We will use it in the script file on my second message…