diff --git a/bot/utils.lua b/bot/utils.lua index f5ef26c..efd8ccb 100644 --- a/bot/utils.lua +++ b/bot/utils.lua @@ -67,8 +67,9 @@ function download_to_file(url, file_name) } local one, c, h = http.request(options) - - local file_name = get_http_file_name(url, h) + + file_name = file_name or get_http_file_name(url, h) + local file_path = "/tmp/"..file_name print("Saved to: "..file_path) @@ -311,4 +312,4 @@ function send_document_from_url(receiver, url, cb_function, cb_extra) local file_path = download_to_file(url, false) print("File path: "..file_path) _send_document(receiver, file_path, cb_function, cb_extra) -end \ No newline at end of file +end