Interface CreateMessageOptions

interface CreateMessageOptions {
    allowedMentions?: AllowedMentions;
    attachments?: MessageAttachment[];
    components?: MessageActionRow[];
    content?: string;
    embeds?: EmbedOptions[];
    enforceNonce?: boolean;
    files?: File[];
    flags?: number;
    messageReference?: MessageReference;
    nonce?: string | number;
    poll?: MessagePollOptions;
    stickerIDs?: string[];
    tts?: boolean;
}

Properties

allowedMentions?: AllowedMentions

An object that specifies the allowed mentions in this message.

attachments?: MessageAttachment[]

An array of partial attachments related to the sent files.

components?: MessageActionRow[]

An array of components to send. snake_case keys should be converted to camelCase, or passed through Util#rawMessageComponents.

content?: string

The content of the message.

embeds?: EmbedOptions[]

An array of embeds to send. snake_case keys should be converted to camelCase, or passed through Util#rawEmbeds.

enforceNonce?: boolean

If Discord should enforce the unique nonce. This prevents duplicate messages being sent within a few minutes.

files?: File[]

The files to send.

flags?: number

The flags to send with the message.

messageReference?: MessageReference

Reply to a message.

nonce?: string | number

A unique number or string used to dedupe this message. enforceNonce must be set to true for Discord to dedupe message sends.

A poll to send. Messages with a poll cannot be edited.

Note

As of 4/18/24, attachments cannot be sent with polls.

stickerIDs?: string[]

The IDs of up to 3 stickers from the current guild to send.

tts?: boolean

If the message should be spoken aloud.