topkecleon / telegram-bot-bash

Telegram bot written in bash
Other
426 stars 123 forks source link

Send file content or command output #181

Closed nzurita closed 3 years ago

nzurita commented 3 years ago

Hello, I'd like to use bashbot to send command outputs or command logs (the content of the log, not the attached file).

I've tryed these commands:

    $echo "Hello" | telegram-bot-bash/bin/send_message.sh "123456"
    $telegram-bot-bash/bin/send_message.sh "123456" < file.log
    $telegram-bot-bash/bin/send_file.sh "123456" file.log "Your log"

None of them seem to work, is there a way to do it?

Thank you.

gnadelwartz commented 3 years ago

does send_message.sh BOTADMIN "test" send test to you telegram acount?

If yes: use send_message.sh BOTADMIN "$(echo "hello")" or send_message.sh BOTADMIN "$(<file.log)"

If no: run bashbot.sh init, send your bot a command from Telegram, e.g. /help and try again

Nevertheless I'll add the usual '-' as read from STDIN in next release

nzurita commented 3 years ago

It did work, thank you (replacing BOTADMIN by chat number, I was it's what you meant)