Parameterized script to send a message via Telegram bot.
-
Register Telegram bot, get API TOKEN, add them to your chat and get CHAT ID. See: official Telegram instruction
-
Run it with your API TOKEN and CHAT ID to send a MESSAGE, e.g.:
TELEGRAM_API_TOKEN="<API TOKEN>" ./send_message_via_telegram_bot.py 'Your message' -c '<CHAT ID>'"
or pass your API TOKEN via
-o
key (not recommended, but also possible):./send_message_via_telegram_bot.py 'Your message' -c '<CHAT ID>' -o '<API TOKEN>'
-
To get info about other possible options:
./send_message_via_telegram_bot.py -h