This commit is contained in:
Andreas Bielawski 2016-10-04 13:28:18 +02:00
commit 10f95af141

View File

@ -120,7 +120,7 @@ function utilities.send_photo(chat_id, file, text, reply_to_message_id, reply_ma
photo = file photo = file
} }
) )
if string.match(file, '/tmp/') then if string.match(file, '^/tmp/') then
os.remove(file) os.remove(file)
print("Deleted: "..file) print("Deleted: "..file)
end end
@ -144,7 +144,7 @@ function utilities.send_audio(chat_id, file, text, reply_to_message_id, duration
audio = file audio = file
} }
) )
if string.match(file, '/tmp/') then if string.match(file, '^/tmp/') then
os.remove(file) os.remove(file)
print("Deleted: "..file) print("Deleted: "..file)
end end
@ -166,7 +166,7 @@ function utilities.send_document(chat_id, file, text, reply_to_message_id, reply
document = file document = file
} }
) )
if string.match(file, '/tmp/') then if string.match(file, '^/tmp/') then
os.remove(file) os.remove(file)
print("Deleted: "..file) print("Deleted: "..file)
end end
@ -190,7 +190,7 @@ function utilities.send_video(chat_id, file, text, reply_to_message_id, duration
video = file video = file
} }
) )
if string.match(file, '/tmp/') then if string.match(file, '^/tmp/') then
os.remove(file) os.remove(file)
print("Deleted: "..file) print("Deleted: "..file)
end end
@ -213,7 +213,7 @@ function utilities.send_voice(chat_id, file, text, reply_to_message_id, duration
voice = file voice = file
} }
) )
if string.match(file, '/tmp/') then if string.match(file, '^/tmp/') then
os.remove(file) os.remove(file)
print("Deleted: "..file) print("Deleted: "..file)
end end