kitazith/webhook/edit

Types

Represents the three possible states of a field in an edit request: omit it, set it to a new value, or clear its current value.

Learn more: Webhook Resource - Documentation - Discord > Edit Webhook Message

For Discord API v10 and later, attachments must contain all attachments that should be present after the edit, including retained and new attachments.

pub type EditField(a) {
  Omit
  Set(a)
  Clear
}

Constructors

  • Omit

    Do not include the key in the request body. The current value is left unchanged.

  • Set(a)

    Include the key in the request body with a new value.

  • Clear

    Include the key in the request body as null to explicitly clear the current value.

pub type EditPayload {
  EditPayload(
    content: EditField(String),
    embeds: EditField(List(embed.Embed)),
    attachments: EditField(List(attachment.Attachment)),
    components: EditField(List(component.Component)),
    allowed_mentions: EditField(allowed_mentions.AllowedMentions),
    flags: EditField(List(EditPayloadFlag)),
  )
}

Constructors

pub type EditPayloadFlag {
  SuppressEmbeds
  IsComponentsV2
}

Constructors

  • SuppressEmbeds

    Include no embeds

  • IsComponentsV2

Values

pub fn clear_allowed_mentions(
  payload: EditPayload,
) -> EditPayload
pub fn clear_attachments(payload: EditPayload) -> EditPayload
pub fn clear_components(payload: EditPayload) -> EditPayload
pub fn clear_content(payload: EditPayload) -> EditPayload
pub fn clear_embeds(payload: EditPayload) -> EditPayload
pub fn clear_flags(payload: EditPayload) -> EditPayload
pub fn new() -> EditPayload
pub fn to_json(payload: EditPayload) -> json.Json
pub fn to_string(payload: EditPayload) -> String
pub fn to_string_tree(
  payload: EditPayload,
) -> string_tree.StringTree
pub fn validate(
  payload: EditPayload,
) -> Result(EditPayload, List(validation.ValidationError))
pub fn validate_with_query(
  payload: EditPayload,
  query: edit_query.EditQuery,
) -> Result(EditPayload, List(validation.ValidationError))
pub fn with_allowed_mentions(
  payload: EditPayload,
  mentions: allowed_mentions.AllowedMentions,
) -> EditPayload
pub fn with_attachments(
  payload: EditPayload,
  attachments: List(attachment.Attachment),
) -> EditPayload
pub fn with_components(
  payload: EditPayload,
  components: List(component.Component),
) -> EditPayload
pub fn with_content(
  payload: EditPayload,
  content: String,
) -> EditPayload
pub fn with_embeds(
  payload: EditPayload,
  embeds: List(embed.Embed),
) -> EditPayload
pub fn with_flags(
  payload: EditPayload,
  flags: List(EditPayloadFlag),
) -> EditPayload
Search Document