kitazith/attachment

Types

pub type Attachment {
  Attachment(
    id: Int,
    filename: String,
    description: option.Option(String),
  )
}

Constructors

  • Attachment(
      id: Int,
      filename: String,
      description: option.Option(String),
    )

    Arguments

    description

    At least 1 character and up to 1024 characters.

Values

pub fn new(id id: Int, filename filename: String) -> Attachment
pub fn to_embed_url(attachment: Attachment) -> String

Format an attachment for use in embed image or thumbnail URLs.

Discord accepts attachment://filename to reference uploaded attachments from embeds in the same message payload.

pub fn to_json(a: Attachment) -> json.Json
pub fn with_description(
  attachment: Attachment,
  description: String,
) -> Attachment
Search Document