new plugin dogify

This commit is contained in:
Akamaru 2015-05-16 20:32:21 +02:00
parent c5bf43c1b9
commit 294d5f836c

20
plugins/dogify.lua Normal file
View File

@ -0,0 +1,20 @@
local function run(msg, matches)
local base = "http://dogr.io/"
local path = string.gsub(matches[1], " ", "")
local url = base .. path .. '.png'
local urlm = "https?://[%w-_%.%?%.:/%+=&]+"
if string.match(url, urlm) == url then
local receiver = get_receiver(msg)
send_photo_from_url(receiver, url)
else
return 'Konnte kein Bild mit "' .. matches[1] .. '" erstellen'
end
end
return {
description = "Erstelle ein Doge Bild mit Wörtern",
usage = {"/dogify das/was/du/willst"},
patterns = {"^/dogify (.+)$"},
run = run
}