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
-
OmitDo 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.
-
ClearInclude the key in the request body as
nullto 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
-
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)), )Arguments
- content
-
Up to 2000 characters.
- embeds
-
Up to 10 embeds.
Up to 6000 characters total across all
title,description,field.name,field.value,footer.text, andauthor.namefields in all embeds per message.Source: Message Resource - Documentation - Discord > Embed Object > Embed Limits
pub type EditPayloadFlag {
SuppressEmbeds
IsComponentsV2
}
Constructors
-
SuppressEmbedsInclude 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