From 6252ca7703f7aadea4f14459b7692c5017aedc94 Mon Sep 17 00:00:00 2001 From: Dawid Rejowski Date: Sun, 11 Sep 2022 22:39:34 +0200 Subject: [PATCH] File suffix when uploading sticker --- matrix_reuploader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix_reuploader.py b/matrix_reuploader.py index efa1a85..ba93fea 100644 --- a/matrix_reuploader.py +++ b/matrix_reuploader.py @@ -46,7 +46,7 @@ class MatrixReuploader: converted_stickerset = await self.exporter.get_stickerset(stickerset.name()) yield self.STATUS_UPLOADING for sticker in converted_stickerset: - with tempfile.NamedTemporaryFile('w+b') as file: + with tempfile.NamedTemporaryFile('w+b', suffix=sticker.mime_type.replace('image/', '')) as file: file.write(sticker.image_data) sticker_mxc = await upload_image(self.client, file.name, sticker.mime_type) stickerset.add_sticker(sticker_mxc, sticker.alt_text)