FalconyKlayil | if sticker_id in old_stickers:
pass # in real code if the sticker is the same as the old one it'll keep it
else:
image_data, width, height = image_data if path.endswith('.gif') else util.convert_image(image_data) # does not convert only if it is only a gif
print(".", end="", flush=True)
mxc = await matrix.upload(image_data, "image/" + (".gif" if path.endswith('.gif') else ".png"), file) # the mimetype will be a gif if the file is a gif if it is not it will be a png mimetype
print(".", end="", flush=True)
sticker = util.make_sticker(mxc, width, height, len(image_data), name)
sticker["id"] = sticker_id
print(" uploaded", flush=True)
return sticker
| 16:06:26 |