pub struct MessageBuilder<'a> { /* private fields */ }Expand description
Builder for creating a Message.
Implementations§
Source§impl<'a> MessageBuilder<'a>
impl<'a> MessageBuilder<'a>
Sourcepub fn text(content: impl Into<TitanString<'a>>) -> Self
pub fn text(content: impl Into<TitanString<'a>>) -> Self
Create a message with just text content.
Sourcepub fn content(self, content: impl Into<TitanString<'a>>) -> Self
pub fn content(self, content: impl Into<TitanString<'a>>) -> Self
Set the content of the message.
Sourcepub fn reply(self, message_id: impl Into<Snowflake>) -> Self
pub fn reply(self, message_id: impl Into<Snowflake>) -> Self
Reply to a message (sets message_reference).
Sourcepub fn component(self, component: impl Into<Component<'a>>) -> Self
pub fn component(self, component: impl Into<Component<'a>>) -> Self
Add a component (ActionRow, etc.) to the message.
Sourcepub fn add_file(
self,
filename: impl Into<TitanString<'a>>,
data: impl Into<Vec<u8>>,
) -> Self
pub fn add_file( self, filename: impl Into<TitanString<'a>>, data: impl Into<Vec<u8>>, ) -> Self
Add a file to upload.
Sourcepub fn build(self) -> CreateMessage<'a>
pub fn build(self) -> CreateMessage<'a>
Build the CreateMessage payload.
Trait Implementations§
Source§impl<'a> Clone for MessageBuilder<'a>
impl<'a> Clone for MessageBuilder<'a>
Source§fn clone(&self) -> MessageBuilder<'a>
fn clone(&self) -> MessageBuilder<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for MessageBuilder<'a>
impl<'a> Debug for MessageBuilder<'a>
Source§impl<'a> Default for MessageBuilder<'a>
impl<'a> Default for MessageBuilder<'a>
Source§fn default() -> MessageBuilder<'a>
fn default() -> MessageBuilder<'a>
Returns the “default value” for a type. Read more
Source§impl<'a> From<MessageBuilder<'a>> for CreateMessage<'a>
MessageBuilder automatically converts to CreateMessage
impl<'a> From<MessageBuilder<'a>> for CreateMessage<'a>
MessageBuilder automatically converts to CreateMessage
Source§fn from(builder: MessageBuilder<'a>) -> Self
fn from(builder: MessageBuilder<'a>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for MessageBuilder<'a>
impl<'a> RefUnwindSafe for MessageBuilder<'a>
impl<'a> Send for MessageBuilder<'a>
impl<'a> Sync for MessageBuilder<'a>
impl<'a> Unpin for MessageBuilder<'a>
impl<'a> UnwindSafe for MessageBuilder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more