/bash
Last active
August 31, 2023 08:44
Sending file via Telegram from terminal
This file contains 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 | |
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