This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Mikubot/plugins/dogify.lua

20 lines
593 B
Lua
Raw Normal View History

2015-05-16 20:32:21 +02:00
local function run(msg, matches)
local base = "http://dogr.io/"
2015-06-07 22:50:19 +02:00
local path = string.gsub(matches[1], " ", "%%20")
local url = base .. path .. '.png?split=false&.png'
local urlm = "https?://[%%%w-_%.%?%.:/%+=&]+"
2015-05-16 20:32:21 +02:00
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
}