Skip to content

Latest commit

 

History

History
46 lines (28 loc) · 1.53 KB

image.md

File metadata and controls

46 lines (28 loc) · 1.53 KB

Image

Represents a class for all image endpoints.

Attributes

  • url (str): The URL of the image.

Methods

await read(bytesio: bool = True) -> bytes | io.BytesIO

Retrieves the image data asynchronously.

  • If bytesio is True (default), returns an io.BytesIO object containing the image data.
  • If bytesio is False, returns the raw image data as bytes.

Parameters

Returns


await file(cls: FileLike, filename: str = "image.png") -> FileLike

Converts the image into a file-like object, suitable for uploading or further processing.

Parameters

  • cls (FileLike): The file-like class or object to use (e.g., discord.File from discord.py).
  • filename (Optional[str]): The filename to assign to the image. Defaults to "image.png".

Returns

  • FileLike: The image wrapped in the specified file-like object.