Struct twilight_http::request::application::CreateFollowupMessage[][src]

pub struct CreateFollowupMessage<'a> { /* fields omitted */ }
Expand description

Create a followup message to an interaction.

You must specify at least one of content, embeds, or files.

Examples

use std::env;
use twilight_http::Client;
use twilight_model::id::ApplicationId;

let client = Client::new(env::var("DISCORD_TOKEN")?);
client.set_application_id(ApplicationId(1));

client
    .create_followup_message("webhook token")?
    .content("Pinkie...")
    .exec()
    .await?;

Implementations

Specify the AllowedMentions for the webhook message.

The URL of the avatar of the webhook.

The content of the webook’s message.

Up to 2000 UTF-16 codepoints.

Set the list of embeds of the webhook’s message.

Set if the followup should be ephemeral.

Attach multiple files to the webhook.

JSON encoded body of any additional request fields.

If this method is called, all other fields are ignored, except for file. See Discord Docs/Create Message.

Examples

Without payload_json:

use std::env;
use twilight_embed_builder::EmbedBuilder;
use twilight_http::Client;
use twilight_model::id::{MessageId, ApplicationId};

let client = Client::new(env::var("DISCORD_TOKEN")?);
client.set_application_id(ApplicationId(1));

let message = client.create_followup_message("token here")?
    .content("some content")
    .embeds(&[EmbedBuilder::new().title("title").build()?])
    .exec()
    .await?
    .model()
    .await?;

assert_eq!(message.content, "some content");

With payload_json:

use std::env;
use twilight_http::Client;
use twilight_model::id::{MessageId, ApplicationId};

let client = Client::new(env::var("DISCORD_TOKEN")?);
client.set_application_id(ApplicationId(1));

let message = client.create_followup_message("token here")?
    .content("some content")
    .payload_json(br#"{ "content": "other content", "embeds": [ { "title": "title" } ] }"#)
    .exec()
    .await?
    .model()
    .await?;

assert_eq!(message.content, "other content");

Specify true if the message is TTS.

Specify the username of the webhook’s message.

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.