Struct twilight_http::request::channel::message::create_message::CreateMessage [−][src]
pub struct CreateMessage<'a> { /* fields omitted */ }
Expand description
Send a message to a channel.
Example
use twilight_http::Client;
use twilight_model::id::ChannelId;
let client = Client::new("my token".to_owned());
let channel_id = ChannelId(123);
let message = client
.create_message(channel_id)
.content("Twilight is best pony")?
.tts(true)
.exec()
.await?;
Implementations
Specify the AllowedMentions
for the message.
Add multiple Component
s to a message.
Calling this method multiple times will clear previous calls.
Errors
Returns an CreateMessageErrorType::ComponentCount
error type if
too many components are provided.
Returns an CreateMessageErrorType::ComponentInvalid
error type if
one of the provided components is invalid.
Set the content of the message.
The maximum length is 2000 UTF-16 characters.
Errors
Returns a CreateMessageErrorType::ContentInvalid
error type if the
content length is too long.
Attach multiple embeds to the message.
Embed total character length must not exceed 6000 characters. Additionally, the internal fields also have character limits. Refer to the discord docs for more information.
Errors
Returns a CreateMessageErrorType::EmbedTooLarge
error type if an
embed is too large.
Whether to fail sending if the reply no longer exists.
Attach multiple files to the message.
Calling this method will clear any previous calls.
Attach a nonce to the message, for optimistic message sending.
JSON encoded body of any additional request fields.
If this method is called, all other fields are ignored, except for
files
. See Discord Docs/Create Message.
Specify the ID of another message to create a reply to.
pub fn exec(self) -> ResponseFuture<Message>ⓘNotable traits for ResponseFuture<T>impl<T: Unpin> Future for ResponseFuture<T> type Output = Result<Response<T>, Error>;
pub fn exec(self) -> ResponseFuture<Message>ⓘNotable traits for ResponseFuture<T>impl<T: Unpin> Future for ResponseFuture<T> type Output = Result<Response<T>, Error>;
impl<T: Unpin> Future for ResponseFuture<T> type Output = Result<Response<T>, Error>;
Execute the request, returning a future resolving to a Response
.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for CreateMessage<'a>
impl<'a> Send for CreateMessage<'a>
impl<'a> Sync for CreateMessage<'a>
impl<'a> Unpin for CreateMessage<'a>
impl<'a> !UnwindSafe for CreateMessage<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more