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