Last active
March 10, 2019 20:28
-
-
Save nikmonkov/81ff2f61cdc0894cc2e3b100c131b87e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Example: echo "Hello" | telegram.sh | |
| # | |
| message="$@" | |
| apiToken=395177535:AAEDYijg_MMbPComaJVdplFfLX43ytdjEyc | |
| chatId=-233825489 | |
| send() { | |
| curl -s \ | |
| -X POST \ | |
| https://api.telegram.org/bot$apiToken/sendMessage \ | |
| -d text="$message" \ | |
| -d chat_id=$chatId | |
| } | |
| if [[ ! -z "$message" ]]; then | |
| send | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment