diff --git a/plugins/gifs.lua b/plugins/gifs.lua index 1a12a9a..66e685f 100644 --- a/plugins/gifs.lua +++ b/plugins/gifs.lua @@ -1,11 +1,7 @@ -function send_file_from_url (msg, url) - last = string.get_last_word(ul) - file = download_to_file(last) - send_document(get_receiver(msg), file, ok_cb, false) -end function run(msg, matches) - send_file_from_url(msg, matches[1]) + file = download_to_file(matches[1]) + send_document(get_receiver(msg), file, ok_cb, false) end return { diff --git a/plugins/images.lua b/plugins/images.lua index 115b30d..82f3b63 100644 --- a/plugins/images.lua +++ b/plugins/images.lua @@ -1,13 +1,8 @@ -function send_image_from_url (msg) - last = string.get_last_word(msg.text) - file = download_to_file(last) - print("I will send the image " .. file) - send_photo(get_receiver(msg), file, ok_cb, false) -end - function run(msg, matches) - send_image_from_url(msg) + file = download_to_file(matches[1]) + print("I will send the image " .. file) + send_photo(get_receiver(msg), file, ok_cb, false) end return {