Skip to content

Struct EditMessage

zaun_client::EditMessage · Struct

pub struct EditMessage { … }

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).

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.

pub fn mention_role(self, role: RoleId) -> Self

Notifies the members with role, as MessageOptions::mention_role.

pub fn mention_everyone(self) -> Self

Notifies everyone who can see the channel (needs MENTION_EVERYONE; dropped without).

pub fn mentions(self, mentions: Mentions) -> Self

Replaces the message’s mentions with exactly mentions; Mentions::default clears them, @everyone too.

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.

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.

pub fn content<impl Into<String>>(self, content: impl Into<String>) -> Self

The new text.

pub fn embed<impl Into<EmbedBuilder>>(self, embed: impl Into<EmbedBuilder>) -> Self

Replaces the embeds with these, starting with this one.

pub fn embeds<impl Into<EmbedBuilder>, impl IntoIterator<Item = impl Into<EmbedBuilder>>>(self, embeds: impl IntoIterator<Item = impl Into<EmbedBuilder>>) -> Self

Replaces the embeds with embeds (none removes them all).

pub fn clear_embeds(self) -> Self

Removes every embed.

Clone, Debug, Default, Eq, From<&String>, From<&str>, From<EmbedBuilder>, From<String>, PartialEq, StructuralPartialEq

Full rustdoc page