Skip to content

BackpackItem

Properties

id : str

The ID of the backpack item (a UUID).

name : str

The name of the item.

body_URL : str

The URL of the content of the item.

thumbnail_URL : str

The URL of the thumbnail of the item.

mime : Literal["application/zip"] | Literal["application/json"] | Literal["audio/x-wav"] | Literal["audio/mp3"] | Literal["image/svg+xml"] | Literal["image/png"]

The MIME type of the item.

type : Literal["script"] | Literal["costume"] | Literal["sound"] | Literal["sprite"]

The type of item that the item is.

Methods

delete()

Deletes the item.

Example:

import base64
from PIL import Image
from io import BytesIO

costume_file = open("furry.png", "rb")
body = base64.b64encode(costume_file.read())

image = Image.open("furry.png")
with BytesIO() as f:
    image.save(f, format="JPEG")
    thumbnail = base64.b64encode(f.getvalue())
    item = session.add_to_backpack("costume", body, "image/png", "furry", thumbnail)
    item.delete()