Skip to content

Instantly share code, notes, and snippets.

@nikmonkov
Last active March 10, 2019 20:28
Show Gist options
  • Select an option

  • Save nikmonkov/81ff2f61cdc0894cc2e3b100c131b87e to your computer and use it in GitHub Desktop.

Select an option

Save nikmonkov/81ff2f61cdc0894cc2e3b100c131b87e to your computer and use it in GitHub Desktop.
#!/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