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/get_data.lua
Andreas Bielawski d9a6836dd5 - Portiere get_data
- Ergänze Antworten da, wo ich es vergessen habe...
2016-08-18 17:38:20 +02:00

27 lines
684 B
Lua

local get_data = {}
function get_data:init(config)
get_data.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('wget', true).table
get_data.doc = '\n*/wget* _<URL>_'
end
get_data.command = 'me'
function get_data:action(msg, config)
local input = utilities.input_from_msg(msg)
if not input then
utilities.send_reply(self, msg, get_data.doc, true)
return
end
utilities.send_typing(self, msg.chat.id, 'upload_document')
local file = download_to_file(input)
if not file then
utilities.send_reply(self, msg, config.errors.connection)
return
end
utilities.send_document(self, msg.chat.id, file, nil, msg.message_id)
end
return get_data