From 88e0336227628d583575c9091973560996649730 Mon Sep 17 00:00:00 2001 From: yago Date: Tue, 4 Nov 2014 23:06:26 +0100 Subject: [PATCH] doesnt get last word --- plugins/gifs.lua | 8 ++------ plugins/images.lua | 11 +++-------- 2 files changed, 5 insertions(+), 14 deletions(-) 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 {