pub struct EditInteractionResponse(/* private fields */);
Expand description
Implementations§
Source§impl EditInteractionResponse
impl EditInteractionResponse
Sourcepub fn new() -> Self
pub fn new() -> Self
Equivalent to Self::default
.
Sourcepub fn content(self, content: impl Into<String>) -> Self
pub fn content(self, content: impl Into<String>) -> Self
Set the content of the message.
Note: Message contents must be under 2000 unicode code points.
Sourcepub fn add_embed(self, embed: CreateEmbed) -> Self
pub fn add_embed(self, embed: CreateEmbed) -> Self
Adds an embed for the message.
Embeds from the original message are reset when adding new embeds and must be re-added.
Sourcepub fn add_embeds(self, embeds: Vec<CreateEmbed>) -> Self
pub fn add_embeds(self, embeds: Vec<CreateEmbed>) -> Self
Adds multiple embeds to the message.
Embeds from the original message are reset when adding new embeds and must be re-added.
Sourcepub fn embed(self, embed: CreateEmbed) -> Self
pub fn embed(self, embed: CreateEmbed) -> Self
Sets a single embed to include in the message
Calling this will overwrite the embed list. To append embeds, call Self::add_embed
instead.
Sourcepub fn embeds(self, embeds: Vec<CreateEmbed>) -> Self
pub fn embeds(self, embeds: Vec<CreateEmbed>) -> Self
Sets the embeds for the message.
Note: You can only have up to 10 embeds per message.
Calling this will overwrite the embed list. To append embeds, call Self::add_embeds
instead.
Sourcepub fn allowed_mentions(self, allowed_mentions: CreateAllowedMentions) -> Self
pub fn allowed_mentions(self, allowed_mentions: CreateAllowedMentions) -> Self
Set the allowed mentions for the message.
Sourcepub fn components(self, components: Vec<CreateActionRow>) -> Self
pub fn components(self, components: Vec<CreateActionRow>) -> Self
Sets the components of this message.
Adds a clickable button to this message.
Convenience method that wraps Self::components
. Arranges buttons in action rows
automatically.
Adds an interactive select menu to this message.
Convenience method that wraps Self::components
.
Sourcepub fn attachments(self, attachments: EditAttachments) -> Self
pub fn attachments(self, attachments: EditAttachments) -> Self
Sets attachments, see EditAttachments
for more details.
Sourcepub fn new_attachment(self, attachment: CreateAttachment) -> Self
pub fn new_attachment(self, attachment: CreateAttachment) -> Self
Adds a new attachment to the message.
Resets existing attachments. See the documentation for EditAttachments
for details.
Sourcepub fn keep_existing_attachment(self, id: AttachmentId) -> Self
pub fn keep_existing_attachment(self, id: AttachmentId) -> Self
Shorthand for EditAttachments::keep
.
Sourcepub fn clear_attachments(self) -> Self
pub fn clear_attachments(self) -> Self
Shorthand for calling Self::attachments
with EditAttachments::new
.
Trait Implementations§
Source§impl Builder for EditInteractionResponse
impl Builder for EditInteractionResponse
Source§fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Edits the initial interaction response. Does not work for ephemeral messages.
The application_id
used will usually be the bot’s UserId
, except if the bot is very
old.
Note: Message contents must be under 2000 unicode code points, and embeds must be under 6000 code points.
§Errors
Returns an Error::Model
if the message content is too long. May also return an
Error::Http
if the API returns an error, or an Error::Json
if there is an error in
deserializing the API response.
Source§type Context<'ctx> = &'ctx str
type Context<'ctx> = &'ctx str
type Built = Message
Source§impl Clone for EditInteractionResponse
impl Clone for EditInteractionResponse
Source§fn clone(&self) -> EditInteractionResponse
fn clone(&self) -> EditInteractionResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more