Skip to content

Instantly share code, notes, and snippets.

@amorev
Last active August 31, 2023 08:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amorev/83219962c3d9368190796d32110f49b0 to your computer and use it in GitHub Desktop.
Save amorev/83219962c3d9368190796d32110f49b0 to your computer and use it in GitHub Desktop.
Sending file via Telegram from terminal
#!/bin/sh
chatId=<YOUR_CHAT_ID>
botToken=<YOUR_BOT_TOKEN>
curdir=$PWD
echo sending $curdir/$1
curl -F chat_id=$chatId -F document=@$curdir/$1 https://api.telegram.org/bot$botToken/sendDocument
# more about gist on my site — amorev.ru/telegram-terminal-file-send
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment