mirror of
https://github.com/wah-su/stickerbridge.git
synced 2025-04-05 15:54:41 +00:00
File suffix when uploading sticker
This commit is contained in:
parent
33efe80c21
commit
6252ca7703
1 changed files with 1 additions and 1 deletions
|
@ -46,7 +46,7 @@ class MatrixReuploader:
|
||||||
converted_stickerset = await self.exporter.get_stickerset(stickerset.name())
|
converted_stickerset = await self.exporter.get_stickerset(stickerset.name())
|
||||||
yield self.STATUS_UPLOADING
|
yield self.STATUS_UPLOADING
|
||||||
for sticker in converted_stickerset:
|
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)
|
file.write(sticker.image_data)
|
||||||
sticker_mxc = await upload_image(self.client, file.name, sticker.mime_type)
|
sticker_mxc = await upload_image(self.client, file.name, sticker.mime_type)
|
||||||
stickerset.add_sticker(sticker_mxc, sticker.alt_text)
|
stickerset.add_sticker(sticker_mxc, sticker.alt_text)
|
||||||
|
|
Loading…
Add table
Reference in a new issue