Multipart

discord_http.multipart module

class discord_http.multipart.MultipartData

Bases: object

attach(name, data, *, filename=None, content_type=None) None

Attach data to the multipart data.

Parameters:
  • name (str) – Name of the file data

  • data (File | BufferedIOBase | dict | str) – The data to attach

  • filename (str | None) – Filename to be sent on Discord

  • content_type (str | None) – The content type of the file data (Defaults to ‘application/octet-stream’ if not provided)

Return type:

None

property content_type: str

The content type of the multipart data.

finish() bytes

Return the multipart data to be sent to Discord.

Return type:

bytes