Last active
August 9, 2018 14:17
-
-
Save arbaaz/8d6f1317ee735cfe6d707ba72ad8848c to your computer and use it in GitHub Desktop.
Send message to Telegram user from a bot
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/sh | |
wget https://gist.githubusercontent.com/arbaaz/8d6f1317ee735cfe6d707ba72ad8848c/raw/98f2546ab980c7d738d5e3eb94cbb736aa1905ca/telegram | |
chmod +x telegram | |
mv telegram /usr/local/bin/telegram |
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/sh | |
# usage ./telegram how you doing? | |
# export TELEGRAM_BOT_TOKEN | |
# export TELEGRAM_CHAT_ID | |
TEXT="$@" | |
curl -s https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage\?chat_id\=$TELEGRAM_CHAT_ID\&text\="$TEXT" > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just run this command