From fc5d204750fbdf89ffb32570f4087fe9ec15f246 Mon Sep 17 00:00:00 2001 From: yago Date: Sun, 15 Feb 2015 14:37:23 +0100 Subject: [PATCH] send_photo_from_url with callback --- bot/utils.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bot/utils.lua b/bot/utils.lua index bfc80f2..ed4f031 100644 --- a/bot/utils.lua +++ b/bot/utils.lua @@ -195,10 +195,11 @@ function _send_photo(receiver, file_path, cb_function, cb_extra) end -- Download the image and send to receiver, it will be deleted. -function send_photo_from_url(receiver, url) +-- cb_function and cb_extra are optionals callback +function send_photo_from_url(receiver, url, cb_function, cb_extra) local file_path = download_to_file(url, false) print("File path: "..file_path) - _send_photo(receiver, file_path) + _send_photo(receiver, file_path, cb_function, cb_extra) end -- Send multimple images asynchronous.