topkecleon / telegram-bot-bash

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

send_file doesn't work for me #187

Open HarrisMt opened 2 years ago

HarrisMt commented 2 years ago

send_file "-781874795" "/var/www/tmp/download.png" "Lool" bin/send_file.sh "-781874795" "/var/www/tmp/download.png" "Lool"

and doesn't get anything, but I send_message function is work for me to send messages.

gnadelwartz commented 2 years ago

by default file to send needs to be in "data-bot-bash" dir and absolute pathnames are not allowed

HarrisMt commented 2 years ago

fine

gnadelwartz commented 2 years ago

From send_file function reference: https://github.com/topkecleon/telegram-bot-bash/blob/master/doc/6_reference.md

For security reasons the following restrictions apply to local files:

absolute path name must match the shell regex FILE_REGEX
relative path name is threated as relative to UPLOADDIR (default: data-bot-bash/upload)
path must not start with ./ and not contain ../
gnadelwartz commented 2 years ago

but you raise a valid point, I will add error resposes to send _file in the next release