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/justkitten.lua
2016-08-17 18:29:52 +02:00

26 lines
673 B
Lua

local jk = {}
function jk:init(config)
jk.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('jk', true).table
jk.doc = '\n*/jk*'
end
jk.command = 'jk'
function jk:action(msg, config)
local JK_URL = 'https://anditest.perseus.uberspace.de/plugins/jk'
local jk_pics = {
"/justkitten1.jpg",
"/justkitten2.jpg",
"/justkitten3.jpg",
"/justkitten4.jpg",
"/justkitten5.jpg",
"/justkitten6.jpg"
}
local random_pic = math.random(#jk_pics)
utilities.send_typing(self, msg.chat.id, 'upload_photo')
local file = download_to_file(JK_URL..jk_pics[random_pic])
utilities.send_photo(self, msg.chat.id, file)
end
return jk