Created
July 24, 2018 13:13
-
-
Save CicoZhang/4c1017a1a2f39fd9f7860e3757c09f66 to your computer and use it in GitHub Desktop.
Telegram bot as a reminder
This file contains 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
function telegram () { | |
curl -s -X POST https://api.telegram.org/bot[Your_API_Key]/sendMessage -d chat_id=[Your_Chat_ID] -d text="$1"} |
This file contains 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 | |
message=$1 | |
if [[ -n "$message" ]]; then | |
curl -s -X POST https://api.telegram.org/bot[Your_API_Key]/sendMessage -d chat_id=[Your_Chat_ID] -d text="$message" | |
else | |
curl -s -X POST https://api.telegram.org/bot[Your_API_Key]/sendMessage -d chat_id=[Your_Chat_ID] -d text="The task is finished." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment