Struct serenity::builder::EditMessage
source · [−]pub struct EditMessage<'a>(pub HashMap<&'static str, Value>, pub Vec<AttachmentType<'a>>);
builder
only.Expand description
Tuple Fields
0: HashMap<&'static str, Value>
1: Vec<AttachmentType<'a>>
Implementations
sourceimpl<'a> EditMessage<'a>
impl<'a> EditMessage<'a>
sourcepub fn content<D: ToString>(&mut self, content: D) -> &mut Self
pub fn content<D: ToString>(&mut self, content: D) -> &mut Self
Set the content of the message.
Note: Message contents must be under 2000 unicode code points.
sourcepub fn add_embed<F>(&mut self, f: F) -> &mut Self where
F: FnOnce(&mut CreateEmbed) -> &mut CreateEmbed,
pub fn add_embed<F>(&mut self, f: F) -> &mut Self where
F: FnOnce(&mut CreateEmbed) -> &mut CreateEmbed,
Add an embed for the message.
Note: This will keep all existing embeds. Use Self::set_embed()
to replace existing
embeds.
sourcepub fn add_embeds(&mut self, embeds: Vec<CreateEmbed>) -> &mut Self
pub fn add_embeds(&mut self, embeds: Vec<CreateEmbed>) -> &mut Self
Add multiple embeds for the message.
Note: This will keep all existing embeds. Use Self::set_embeds()
to replace existing
embeds.
sourcepub fn embed<F>(&mut self, f: F) -> &mut Self where
F: FnOnce(&mut CreateEmbed) -> &mut CreateEmbed,
pub fn embed<F>(&mut self, f: F) -> &mut Self where
F: FnOnce(&mut CreateEmbed) -> &mut CreateEmbed,
Set an embed for the message.
Equivalent to Self::set_embed()
.
Note: This will replace all existing embeds. Use
Self::add_embed()
to add an additional embed.
sourcepub fn set_embed(&mut self, embed: CreateEmbed) -> &mut Self
pub fn set_embed(&mut self, embed: CreateEmbed) -> &mut Self
Set an embed for the message.
Equivalent to Self::embed()
.
Note: This will replace all existing embeds.
Use Self::add_embed()
to add an additional embed.
sourcepub fn set_embeds(&mut self, embeds: Vec<CreateEmbed>) -> &mut Self
pub fn set_embeds(&mut self, embeds: Vec<CreateEmbed>) -> &mut Self
Set multiple embeds for the message.
Note: This will replace all existing embeds. Use Self::add_embeds()
to keep existing
embeds.
sourcepub fn suppress_embeds(&mut self, suppress: bool) -> &mut Self
pub fn suppress_embeds(&mut self, suppress: bool) -> &mut Self
Suppress or unsuppress embeds in the message, this includes those generated by Discord themselves.
sourcepub fn allowed_mentions<F>(&mut self, f: F) -> &mut Self where
F: FnOnce(&mut CreateAllowedMentions) -> &mut CreateAllowedMentions,
pub fn allowed_mentions<F>(&mut self, f: F) -> &mut Self where
F: FnOnce(&mut CreateAllowedMentions) -> &mut CreateAllowedMentions,
Set the allowed mentions for the message.
sourcepub fn components<F>(&mut self, f: F) -> &mut Self where
F: FnOnce(&mut CreateComponents) -> &mut CreateComponents,
pub fn components<F>(&mut self, f: F) -> &mut Self where
F: FnOnce(&mut CreateComponents) -> &mut CreateComponents,
Creates components for this message.
sourcepub fn set_components(&mut self, components: CreateComponents) -> &mut Self
pub fn set_components(&mut self, components: CreateComponents) -> &mut Self
Sets the components of this message.
sourcepub fn flags(&mut self, flags: MessageFlags) -> &mut Self
pub fn flags(&mut self, flags: MessageFlags) -> &mut Self
Sets the flags for the message.
sourcepub fn attachment(
&mut self,
attachment: impl Into<AttachmentType<'a>>
) -> &mut Self
pub fn attachment(
&mut self,
attachment: impl Into<AttachmentType<'a>>
) -> &mut Self
Add a new attachment for the message.
This can be called multiple times.
sourcepub fn add_existing_attachment(&mut self, attachment: AttachmentId) -> &mut Self
pub fn add_existing_attachment(&mut self, attachment: AttachmentId) -> &mut Self
Add an existing attachment by id.
sourcepub fn remove_existing_attachment(
&mut self,
attachment: AttachmentId
) -> &mut Self
pub fn remove_existing_attachment(
&mut self,
attachment: AttachmentId
) -> &mut Self
Remove an existing attachment by id.
Trait Implementations
sourceimpl<'a> Clone for EditMessage<'a>
impl<'a> Clone for EditMessage<'a>
sourcefn clone(&self) -> EditMessage<'a>
fn clone(&self) -> EditMessage<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for EditMessage<'a>
impl<'a> Debug for EditMessage<'a>
sourceimpl<'a> Default for EditMessage<'a>
impl<'a> Default for EditMessage<'a>
sourcefn default() -> EditMessage<'a>
fn default() -> EditMessage<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<'a> !RefUnwindSafe for EditMessage<'a>
impl<'a> Send for EditMessage<'a>
impl<'a> Sync for EditMessage<'a>
impl<'a> Unpin for EditMessage<'a>
impl<'a> !UnwindSafe for EditMessage<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more