Skip to content

Instantly share code, notes, and snippets.

@arbaaz
Last active August 9, 2018 14:17
Show Gist options
  • Save arbaaz/8d6f1317ee735cfe6d707ba72ad8848c to your computer and use it in GitHub Desktop.
Save arbaaz/8d6f1317ee735cfe6d707ba72ad8848c to your computer and use it in GitHub Desktop.
Send message to Telegram user from a bot
#!/bin/sh
wget https://gist.githubusercontent.com/arbaaz/8d6f1317ee735cfe6d707ba72ad8848c/raw/98f2546ab980c7d738d5e3eb94cbb736aa1905ca/telegram
chmod +x telegram
mv telegram /usr/local/bin/telegram
#!/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
@arbaaz
Copy link
Author

arbaaz commented Aug 9, 2018

Just run this command

bash <(wget -qO- https://gist.githubusercontent.com/arbaaz/8d6f1317ee735cfe6d707ba72ad8848c/raw/4b887b9223330d0c089ab04c668022bdabf7bc66/setup.sh)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment