Struct Reply
zaun_bot::Reply · Struct
pub struct Reply(…)Builds a MessageBody. Reply::from("text") is the common case.
Methods
Section titled “Methods”pub fn new() -> SelfAn empty body.
content
Section titled “content”pub fn content<impl Into<String>>(self, text: impl Into<String>) -> SelfSets the text (≤ 4 000 scalars).
pub fn embed<impl Into<Embed>>(self, embed: impl Into<Embed>) -> SelfAdds an embed (≤ 10).
pub fn row(self, row: ActionRow) -> SelfAdds a row of buttons or one select.
component
Section titled “component”pub fn component(self, component: Component) -> SelfAdds any top-level component. Anything but an action row needs v2.
container
Section titled “container”pub fn container(self, container: Container) -> SelfAdds a Components V2 container and switches the message to V2 layout.
pub fn v2(self) -> SelfUses Components V2 layout: no content or embeds, components carry everything.
ephemeral
Section titled “ephemeral”pub fn ephemeral(self) -> SelfOnly the invoker sees it (interaction answers only).
silent
Section titled “silent”pub fn silent(self) -> SelfDelivers without notifying anyone.
attachment
Section titled “attachment”pub fn attachment<impl Into<Id>>(self, id: impl Into<Id>) -> SelfAttaches a file uploaded with crate::messages::upload.
pub fn build(self) -> MessageBodyThe finished body.
mention_member
Section titled “mention_member”pub fn mention_member<impl Into<Id>>(self, id: impl Into<Id>) -> SelfNotifies member id (write mention::member in the text to show where).
mention_members
Section titled “mention_members”pub fn mention_members<impl IntoIterator<Item = Id>>(self, ids: impl IntoIterator<Item = Id>) -> SelfNotifies these members.
mention_role
Section titled “mention_role”pub fn mention_role<impl Into<Id>>(self, id: impl Into<Id>) -> SelfNotifies the members with role id (write mention::role in the text).
mention_roles
Section titled “mention_roles”pub fn mention_roles<impl IntoIterator<Item = Id>>(self, ids: impl IntoIterator<Item = Id>) -> SelfNotifies the members with these roles.
mention_everyone
Section titled “mention_everyone”pub fn mention_everyone(self) -> SelfNotifies everyone who can see the channel (needs MENTION_EVERYONE).
mentions
Section titled “mentions”pub fn mentions(self, mentions: Mentions) -> SelfSets the mentions to exactly mentions (mention::none(): nobody; on an edit, clears
them).
mentions_from_content
Section titled “mentions_from_content”pub fn mentions_from_content(self) -> SelfAdds 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.
Trait implementations
Section titled “Trait implementations”Clone, Debug, Default, From<&str>, From<EmbedBuilder>, From<String>