kitazith/webhook/message

Types

Attachment metadata returned in Discord message objects.

Unlike kitazith/attachment.Attachment, this models the response attachment object returned by webhook execute/edit endpoints.

Learn more: Message Resource - Documentation - Discord > Attachment Object

pub type MessageAttachment {
  MessageAttachment(
    id: snowflake.Snowflake,
    filename: String,
    title: option.Option(String),
    description: option.Option(String),
    content_type: option.Option(String),
    size: Int,
    url: String,
    proxy_url: String,
    height: option.Option(Int),
    width: option.Option(Int),
    ephemeral: option.Option(Bool),
    duration_secs: option.Option(Float),
    waveform: option.Option(String),
    flags: option.Option(Int),
  )
}

Constructors

A minimal subset of Discord’s message object returned by webhook endpoints.

Includes IDs, timestamps, supported flags, and attachment metadata commonly needed after execute webhook or edit webhook responses.

Learn more: Message Resource - Documentation - Discord > Message Object

pub type WebhookMessage {
  WebhookMessage(
    id: snowflake.Snowflake,
    channel_id: snowflake.Snowflake,
    timestamp: timestamp.Timestamp,
    edited_timestamp: option.Option(timestamp.Timestamp),
    webhook_id: option.Option(snowflake.Snowflake),
    flags: option.Option(List(flag.MessageFlag)),
    attachments: List(MessageAttachment),
  )
}

Constructors

Values

pub fn decode(
  body: String,
) -> Result(WebhookMessage, json.DecodeError)

Decode a message object returned from execute webhook with the Query String Param wait set to true.

Search Document