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-2/miku/plugins/dogify.lua
2016-11-29 18:14:26 +01:00

29 lines
805 B
Lua

local dogify = {}
function dogify:init(config)
dogify.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('dogify', true).table
dogify.doc = [[*
]]..config.cmd_pat..[[dogify* _<text/den/du/willst>_: Wow, much doge!
]]
end
dogify.command = 'dogify text/den/du/willst'
function dogify:action(msg, config, matches)
local input = utilities.input_from_msg(msg)
if not input then
utilities.send_reply(msg, dogify.doc, true)
return
end
utilities.send_typing(msg.chat.id, 'upload_photo')
local path = input:gsub(" ", "%%20")
local photo_url = 'http://dogr.io/'..path..'.png?split=false&.png'
if not photo_url then
utilities.send_reply(msg, config.errors.connection)
return
end
utilities.send_photo(msg.chat.id, photo_url, nil, msg.message_id)
end
return dogify