Fix error in saving original zip files

This commit is contained in:
Dusty.P 2018-05-09 21:49:24 -08:00
parent bb6e7aef41
commit f04092355b

View File

@ -23,8 +23,9 @@ class Uploader:
async with ctx.typing(): async with ctx.typing():
if not os.path.isdir(f'{storage_dir}/orig/'): if not os.path.isdir(f'{storage_dir}/orig/'):
os.mkdir(f'{storage_dir}/orig/') os.mkdir(f'{storage_dir}/orig/')
with open(f'{storage_dir}/orig/{attachment.filename}', 'wb') as file: with open(f'{storage_dir}/orig/{attachment.filename}_'
attachment.save(file) f'{ctx.message.created_at.strftime("%Y%m%dT%H%M%S")}', 'wb') as file:
await attachment.save(file)
with BytesIO() as file: with BytesIO() as file:
await attachment.save(file) await attachment.save(file)
unzipped = process_files.load_zip(file) unzipped = process_files.load_zip(file)