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
2017-09-12 19:12:31 +02:00

26 lines
664 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(msg.chat.id, 'upload_photo')
local file = JK_URL..jk_pics[random_pic]
utilities.send_photo(msg.chat.id, file, nil, msg.message_id)
end
return jk