Few changes on kitty.lua and url_title.lua
kitty.lua: Code cleanup url_title.lua: Ignoring deviantart links
This commit is contained in:
parent
5159c65794
commit
94d7d20415
@ -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)
|
||||
@ -12,7 +11,6 @@ function run(msg, matches)
|
||||
send_photo(get_receiver(msg), "pictures/cats/cat4.jpg", ok_cb, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Sendet eins von 4 Katzenbilder",
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user