From 632c513bf7219096dda8962103417dfd1da2a4eb Mon Sep 17 00:00:00 2001 From: Akamaru Date: Wed, 24 Jun 2015 02:32:35 +0200 Subject: [PATCH] img search plugins ignoring svg and send gif as document --- plugins/gay.lua | 11 ++++++++++- plugins/img_google.lua | 9 +++++++++ plugins/img_google_nsfw.lua | 9 +++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/plugins/gay.lua b/plugins/gay.lua index ce8b156..7dafbb0 100644 --- a/plugins/gay.lua +++ b/plugins/gay.lua @@ -34,10 +34,19 @@ function run(msg, matches) if not url then return "Kein Bild gefunden." end + + if string.ends(url, ".svg") then + return "Fehler beim laden des Bildes." + end print("Bilder-URL: ", url) + if string.ends(url, ".gif") then + send_document_from_url(receiver, url) + return "Source: "..url + else send_photo_from_url(receiver, url) - return "Source: "..url + return "Source: "..url + end end return { diff --git a/plugins/img_google.lua b/plugins/img_google.lua index 1a9b95b..750629e 100644 --- a/plugins/img_google.lua +++ b/plugins/img_google.lua @@ -34,10 +34,19 @@ function run(msg, matches) if not url then return "Kein Bild gefunden." end + + if string.ends(url, ".svg") then + return "Fehler beim laden des Bildes." + end print("Bilder-URL: ", url) + if string.ends(url, ".gif") then + send_document_from_url(receiver, url) + return "Source: "..url + else send_photo_from_url(receiver, url) return "Source: "..url + end end return { diff --git a/plugins/img_google_nsfw.lua b/plugins/img_google_nsfw.lua index 257dd82..182e4fe 100644 --- a/plugins/img_google_nsfw.lua +++ b/plugins/img_google_nsfw.lua @@ -34,10 +34,19 @@ function run(msg, matches) if not url then return "Kein Bild gefunden." end + + if string.ends(url, ".svg") then + return "Fehler beim laden des Bildes." + end print("Bilder-URL: ", url) + if string.ends(url, ".gif") then + send_document_from_url(receiver, url) + return "Source: "..url + else send_photo_from_url(receiver, url) return "Source: "..url + end end return {