Difference between revisions of "Telegram"
From PhotoVoltaic Logger new generation
(Created page with "Category:Scripts # Script to send status messages to a telegram chat == Installation == Location: [https://github.com/KKoPV/PVLng-scripts/tree/master/bin Scripts reposit...") |
m (→Installation) |
||
Line 5: | Line 5: | ||
Location: [https://github.com/KKoPV/PVLng-scripts/tree/master/bin Scripts repository] | Location: [https://github.com/KKoPV/PVLng-scripts/tree/master/bin Scripts repository] | ||
+ | |||
+ | === Register your bot === | ||
https://core.telegram.org/bots#botfather | https://core.telegram.org/bots#botfather | ||
− | + | /newbot | |
Remember the token given by @BotFather! | Remember the token given by @BotFather! | ||
− | + | === Send 1st a test message to your bot via client or web. === | |
This is needed to find out the chat id afterwards with | This is needed to find out the chat id afterwards with | ||
− | + | $ curl -X POST <nowiki>https://api.telegram.org/bot</nowiki><span style="color:red"><token></span>/getUpdates | |
− | + | === Find and remember the chat id like this: === | |
− | + | {"ok":true,"result":...<span style="color:red">"chat":{"id":'''1234567890'''</span>,... | |
− | + | === Usage === | |
− | + | # ./telegram.sh token chat message ... | |
− | + | # ./telegram.sh token chat @filename | |
− | + | === References === | |
− | + | * https://core.telegram.org/bots | |
− | + | * https://core.telegram.org/bots/api | |
− | + | * https://core.telegram.org/bots/samples |
Latest revision as of 16:54, 12 September 2020
- Script to send status messages to a telegram chat
Contents
Installation
Location: Scripts repository
Register your bot
https://core.telegram.org/bots#botfather
/newbot
Remember the token given by @BotFather!
Send 1st a test message to your bot via client or web.
This is needed to find out the chat id afterwards with
$ curl -X POST https://api.telegram.org/bot<token>/getUpdates
Find and remember the chat id like this:
{"ok":true,"result":..."chat":{"id":1234567890,...
Usage
# ./telegram.sh token chat message ... # ./telegram.sh token chat @filename