This commit is contained in:
Akamaru 2017-02-15 18:40:14 +01:00
parent fadd16e2c0
commit 7bfe62b917

View File

@ -24,6 +24,7 @@ function media_download:download_to_file_permanently(url, save_dir, file_name)
if code ~= 200 then return false end if code ~= 200 then return false end
local file_path = save_dir..'/'..file_name local file_path = save_dir..'/'..file_name
print(file_path)
file = io.open(file_path, "w+") file = io.open(file_path, "w+")
file:write(table.concat(respbody)) file:write(table.concat(respbody))
file:close() file:close()
@ -39,9 +40,9 @@ function media_download:pre_process(msg, config)
elseif msg.video then elseif msg.video then
file_id = msg.video.file_id file_id = msg.video.file_id
file_size = msg.video.file_size file_size = msg.video.file_size
--[[elseif msg.sticker then elseif msg.sticker then
file_id = msg.sticker.file_id file_id = msg.sticker.file_id
file_size = msg.sticker.file_size]] file_size = msg.sticker.file_size
elseif msg.voice then elseif msg.voice then
file_id = msg.voice.file_id file_id = msg.voice.file_id
file_size = msg.voice.file_size file_size = msg.voice.file_size