From 94d7d204150f4f523b536f1ff57ebaa5988c2876 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Sat, 18 Apr 2015 18:48:20 +0200 Subject: [PATCH] Few changes on kitty.lua and url_title.lua kitty.lua: Code cleanup url_title.lua: Ignoring deviantart links --- plugins/kitty.lua | 2 -- plugins/url_title.lua | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/kitty.lua b/plugins/kitty.lua index 752c7b7..c9f36af 100644 --- a/plugins/kitty.lua +++ b/plugins/kitty.lua @@ -1,6 +1,5 @@ function run(msg, matches) - if string.starts(msg.text, '/kitty') then randomValue = math.random(4) if randomValue == 1 then send_photo(get_receiver(msg), "pictures/cats/cat1.jpg", ok_cb, false) @@ -11,7 +10,6 @@ function run(msg, matches) elseif randomValue == 4 then send_photo(get_receiver(msg), "pictures/cats/cat4.jpg", ok_cb, false) end - end end return { diff --git a/plugins/url_title.lua b/plugins/url_title.lua index 785680e..f3ae580 100644 --- a/plugins/url_title.lua +++ b/plugins/url_title.lua @@ -28,7 +28,7 @@ function run(msg, matches) local title = getTitle(result) -- We don't want 301 (and one Extrawurst for Google), 302, 404 and empty titles - if title == "301 Moved Permanently" or title == "" or title == "404 Not Found" or title == "302 Found" or title == "Moved Permanently" then + if title == "301 Moved Permanently" or title == "" or title == "404 Not Found" or title == "302 Found" or title == "Moved Permanently" or string.match(title, "DeviantArt") then print('Invalide, da "'..title..'"') else return title