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/hdf.lua

26 lines
652 B
Lua
Raw Normal View History

local hdf = {}
function hdf:init(config)
hdf.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('hdf', true).table
hdf.doc = '\n*/hdf*: Einfach mal die Fresse halten!'
end
hdf.command = 'hdf'
function hdf:action(msg, config)
local HDF_URL = 'https://anditest.perseus.uberspace.de/plugins/hdf'
local hdf_pics = {
"/hdf1.jpg",
"/hdf2.jpg",
"/hdf3.jpg",
"/hdf4.jpg",
"/hdf5.jpg"
}
local random_pic = math.random(#hdf_pics)
2016-08-24 17:18:17 +02:00
utilities.send_typing(msg.chat.id, 'upload_photo')
local file = download_to_file(HDF_URL..hdf_pics[random_pic])
2016-08-24 17:18:17 +02:00
utilities.send_photo(msg.chat.id, file)
end
return hdf