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

Specify true if the message is TTS.

Execute the request, returning a future resolving to a Response.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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