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_img.lua
Akamaru 8e0b6e0339 Updates & Fixes
banhammer.lua: Entferne prints
pihole.lua: Anpassung an Pi-hole 3.0
playstation_store.lua: Fix für falschen Namen
plex.lua: Anpassungen (Achtung, dreckig)
special.lua: "Kuma Shock"
Neu! get_img.lua
2017-05-10 13:35:21 +02:00

27 lines
667 B
Lua

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