pub struct Reply(/* private fields */);Expand description
Builds a MessageBody. Reply::from("text") is the common case.
Implementations§
Source§impl Reply
impl Reply
Sourcepub fn component(self, component: Component) -> Self
pub fn component(self, component: Component) -> Self
Adds any top-level component. Anything but an action row needs v2.
Sourcepub fn container(self, container: Container) -> Self
pub fn container(self, container: Container) -> Self
Adds a Components V2 container and switches the message to V2 layout.
Sourcepub fn v2(self) -> Self
pub fn v2(self) -> Self
Uses Components V2 layout: no content or embeds, components carry everything.
Sourcepub fn attachment(self, id: impl Into<Id>) -> Self
pub fn attachment(self, id: impl Into<Id>) -> Self
Attaches a file uploaded with crate::messages::upload.
Sourcepub fn build(self) -> MessageBody
pub fn build(self) -> MessageBody
The finished body.
Source§impl Reply
impl Reply
Sourcepub fn mention_member(self, id: impl Into<Id>) -> Self
pub fn mention_member(self, id: impl Into<Id>) -> Self
Notifies member id (write mention::member in the text to show where).
Sourcepub fn mention_members(self, ids: impl IntoIterator<Item = Id>) -> Self
pub fn mention_members(self, ids: impl IntoIterator<Item = Id>) -> Self
Notifies these members.
Sourcepub fn mention_role(self, id: impl Into<Id>) -> Self
pub fn mention_role(self, id: impl Into<Id>) -> Self
Notifies the members with role id (write mention::role in the text).
Sourcepub fn mention_roles(self, ids: impl IntoIterator<Item = Id>) -> Self
pub fn mention_roles(self, ids: impl IntoIterator<Item = Id>) -> Self
Notifies the members with these roles.
Sourcepub fn mention_everyone(self) -> Self
pub fn mention_everyone(self) -> Self
Notifies everyone who can see the channel (needs MENTION_EVERYONE).
Sourcepub fn mentions(self, mentions: Mentions) -> Self
pub fn mentions(self, mentions: Mentions) -> Self
Sets the mentions to exactly mentions (mention::none(): nobody; on an edit, clears
them).
Sourcepub fn mentions_from_content(self) -> Self
pub fn mentions_from_content(self) -> Self
Adds the mentions the content shows (<@id>, <@&id>, @everyone; see
mention::parse). Call it after content, and only for text the
bot wrote itself, never for text a member gave it.