Skip to content

discohook.file

Classes

File

discohook.file.File

Represents a file to send to Discord.

Arguments

  • name (str | None): Name of the file.
  • content (bytes | None): Content of the file in bytes.
  • description (str | None): Description of the file.
  • spoiler (bool): Whether the file is a spoiler.
  • id (int | None): ID of the file used to identify the file.

Method Index

Methods

from_path

Creates a File object from a file path.

Arguments

  • path (str): Path to the file.
  • spoiler (bool): Whether the file is a spoiler.
  • description (str | None): Description of the file to be sent.
  • id (int | None): ID of the file used to identify the file.

Returns

  • Type: File
    • File object.

from_url

Creates a File object from a file URL.

Arguments

  • url (str): URL to the file.
  • description (str | None): Description of the file to be sent.
  • spoiler (bool): Whether the file is a spoiler.
  • id (int | None): ID of the file used to identify the file.

Returns

  • Type: File
    • File object.