Skip to content

Instantly share code, notes, and snippets.

@jabb3rd
Created February 24, 2017 05:13
Show Gist options
  • Save jabb3rd/e143f3d33514f032ec178ec9e48f8788 to your computer and use it in GitHub Desktop.
Save jabb3rd/e143f3d33514f032ec178ec9e48f8788 to your computer and use it in GitHub Desktop.
Set global variables and functions for Telegram BotAPI
:global tgAPI "https://api.telegram.org/bot123456789:ABCDEF0123456789abcdef0123456789ABC"
:global tgID "123456"
# Telegram BotAPI sendMessage method
# Example: $tgSendMessage $chatid $text
:global tgSendMessage do={
:global tgAPI
:local url ($tgAPI . "/sendMessage\?chat_id=" . $1 . "&text=" . $2)
/tool fetch keep-result=no url="$url"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment