Akamaru
8e0b6e0339
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
27 lines
667 B
Lua
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
|