pub struct EditMessage { /* private fields */ }Expand description
An edit of one of this member’s messages. A plain &str replaces the text and leaves the
embeds and mentions as they are.
An edit uploads nothing: an embed’s pictures must be attachments the message already has
(Picture::Attachment, or an Attachment of it).
Implementations§
Source§impl EditMessage
impl EditMessage
Sourcepub fn mention_member(self, member: MemberId) -> Self
pub fn mention_member(self, member: MemberId) -> Self
Notifies member, as MessageOptions::mention_member.
Any mention on an edit replaces all of the message’s mentions, and needs
SEND_MESSAGES.
Sourcepub fn mention_role(self, role: RoleId) -> Self
pub fn mention_role(self, role: RoleId) -> Self
Notifies the members with role, as
MessageOptions::mention_role.
Sourcepub fn mention_everyone(self) -> Self
pub fn mention_everyone(self) -> Self
Notifies everyone who can see the channel (needs MENTION_EVERYONE; dropped without).
Sourcepub fn mentions(self, mentions: Mentions) -> Self
pub fn mentions(self, mentions: Mentions) -> Self
Replaces the message’s mentions with exactly mentions; Mentions::default clears
them, @everyone too.
Sourcepub const fn mentions_from_content(self) -> Self
pub const fn mentions_from_content(self) -> Self
Also notifies whoever the text shows (see mention::parse): the new text, or the
message’s own when the edit keeps it. The edit then always sends mentions, so text
that shows none clears them. Only for text this member wrote.
Source§impl EditMessage
impl EditMessage
Sourcepub fn new() -> Self
pub fn new() -> Self
An edit that changes nothing yet: the text stays (a Message knows
it; a PartialMessage needs content), and
so do the embeds.
Sourcepub fn embed(self, embed: impl Into<EmbedBuilder>) -> Self
pub fn embed(self, embed: impl Into<EmbedBuilder>) -> Self
Replaces the embeds with these, starting with this one.
Sourcepub fn embeds(
self,
embeds: impl IntoIterator<Item = impl Into<EmbedBuilder>>,
) -> Self
pub fn embeds( self, embeds: impl IntoIterator<Item = impl Into<EmbedBuilder>>, ) -> Self
Replaces the embeds with embeds (none removes them all).
Sourcepub fn clear_embeds(self) -> Self
pub fn clear_embeds(self) -> Self
Removes every embed.
Trait Implementations§
Source§impl Clone for EditMessage
impl Clone for EditMessage
Source§fn clone(&self) -> EditMessage
fn clone(&self) -> EditMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more