diff --git a/src/index.js b/src/index.js index ca84b6ea4..e41887e57 100644 --- a/src/index.js +++ b/src/index.js @@ -57,7 +57,6 @@ module.exports = { ApplicationCommand: require('./structures/ApplicationCommand'), Base: require('./structures/Base'), Activity: require('./structures/Presence').Activity, - APIMessage: require('./structures/APIMessage'), BaseGuild: require('./structures/BaseGuild'), BaseGuildEmoji: require('./structures/BaseGuildEmoji'), BaseGuildVoiceChannel: require('./structures/BaseGuildVoiceChannel'), @@ -96,6 +95,7 @@ module.exports = { MessageComponentInteractionCollector: require('./structures/MessageComponentInteractionCollector'), MessageEmbed: require('./structures/MessageEmbed'), MessageMentions: require('./structures/MessageMentions'), + MessagePayload: require('./structures/MessagePayload'), MessageReaction: require('./structures/MessageReaction'), MessageSelectMenu: require('./structures/MessageSelectMenu'), NewsChannel: require('./structures/NewsChannel'), diff --git a/src/managers/MessageManager.js b/src/managers/MessageManager.js index 06c8b9293..9ec70ef01 100644 --- a/src/managers/MessageManager.js +++ b/src/managers/MessageManager.js @@ -2,8 +2,8 @@ const BaseManager = require('./BaseManager'); const { TypeError } = require('../errors'); -const APIMessage = require('../structures/APIMessage'); const Message = require('../structures/Message'); +const MessagePayload = require('../structures/MessagePayload'); const Collection = require('../util/Collection'); const LimitedCollection = require('../util/LimitedCollection'); @@ -116,16 +116,16 @@ class MessageManager extends BaseManager { /** * Edits a message, even if it's not cached. * @param {MessageResolvable} message The message to edit - * @param {MessageEditOptions|APIMessage} [options] The options to provide + * @param {MessageEditOptions|MessagePayload} [options] The options to provide * @returns {Promise} */ async edit(message, options) { const messageID = this.resolveID(message); if (!messageID) throw new TypeError('INVALID_TYPE', 'message', 'MessageResolvable'); - const { data, files } = await (options instanceof APIMessage + const { data, files } = await (options instanceof MessagePayload ? options - : APIMessage.create(message instanceof Message ? message : this, options) + : MessagePayload.create(message instanceof Message ? message : this, options) ) .resolveData() .resolveFiles(); diff --git a/src/structures/InteractionWebhook.js b/src/structures/InteractionWebhook.js index afde7af54..0c3bcfd22 100644 --- a/src/structures/InteractionWebhook.js +++ b/src/structures/InteractionWebhook.js @@ -28,8 +28,8 @@ class InteractionWebhook { /* eslint-disable no-empty-function, valid-jsdoc */ /** * Sends a message with this webhook. - * @param {string|APIMessage|InteractionReplyOptions} options The content for the reply - * @returns {Promise} + * @param {string|MessagePayload|InteractionReplyOptions} options The content for the reply + * @returns {Promise} */ send() {} fetchMessage() {} diff --git a/src/structures/Message.js b/src/structures/Message.js index ef0599dff..1fed025c3 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -1,6 +1,5 @@ 'use strict'; -const APIMessage = require('./APIMessage'); const Base = require('./Base'); const BaseMessageComponent = require('./BaseMessageComponent'); const ClientApplication = require('./ClientApplication'); @@ -8,6 +7,7 @@ const MessageAttachment = require('./MessageAttachment'); const MessageComponentInteractionCollector = require('./MessageComponentInteractionCollector'); const Embed = require('./MessageEmbed'); const Mentions = require('./MessageMentions'); +const MessagePayload = require('./MessagePayload'); const ReactionCollector = require('./ReactionCollector'); const Sticker = require('./Sticker'); const { Error } = require('../errors'); @@ -26,7 +26,7 @@ const Util = require('../util/Util'); class Message extends Base { /** * @param {Client} client The instantiating client - * @param {APIMessageRaw} data The data for the message + * @param {APIMessage} data The data for the message * @param {TextChannel|DMChannel|NewsChannel} channel The channel the message was sent in */ constructor(client, data, channel) { @@ -300,7 +300,7 @@ class Message extends Base { /** * Updates the message and returns the old message. - * @param {APIMessageRaw} data Raw Discord message update data + * @param {APIMessage} data Raw Discord message update data * @returns {Message} * @private */ @@ -565,7 +565,7 @@ class Message extends Base { /** * Edits the content of the message. - * @param {string|APIMessage|MessageEditOptions} options The options to provide + * @param {string|MessagePayload|MessageEditOptions} options The options to provide * @returns {Promise} * @example * // Update the content of a message @@ -667,7 +667,7 @@ class Message extends Base { /** * Send an inline reply to this message. - * @param {string|APIMessage|ReplyMessageOptions} options The options to provide + * @param {string|MessagePayload|ReplyMessageOptions} options The options to provide * @returns {Promise} * @example * // Reply to a message @@ -678,10 +678,10 @@ class Message extends Base { reply(options) { let data; - if (options instanceof APIMessage) { + if (options instanceof MessagePayload) { data = options; } else { - data = APIMessage.create(this, options, { + data = MessagePayload.create(this, options, { reply: { messageReference: this, failIfNotExists: options?.failIfNotExists ?? true, @@ -754,7 +754,7 @@ class Message extends Base { * without checking all the properties, use `message.id === message2.id`, which is much more efficient. This * method allows you to see if there are differences in content, embeds, attachments, nonce and tts properties. * @param {Message} message The message to compare it to - * @param {APIMessageRaw} rawData Raw data passed through the WebSocket about this message + * @param {APIMessage} rawData Raw data passed through the WebSocket about this message * @returns {boolean} */ equals(message, rawData) { diff --git a/src/structures/MessageComponentInteraction.js b/src/structures/MessageComponentInteraction.js index 62bc95aba..ac28215ea 100644 --- a/src/structures/MessageComponentInteraction.js +++ b/src/structures/MessageComponentInteraction.js @@ -16,7 +16,7 @@ class MessageComponentInteraction extends Interaction { /** * The message to which the component was attached - * @type {?(Message|APIMessageRaw)} + * @type {?(Message|APIMessage)} */ this.message = data.message ? this.channel?.messages.add(data.message) ?? data.message : null; diff --git a/src/structures/APIMessage.js b/src/structures/MessagePayload.js similarity index 97% rename from src/structures/APIMessage.js rename to src/structures/MessagePayload.js index 56431bab6..ae2229548 100644 --- a/src/structures/APIMessage.js +++ b/src/structures/MessagePayload.js @@ -11,7 +11,7 @@ const Util = require('../util/Util'); /** * Represents a message to be sent to the API. */ -class APIMessage { +class MessagePayload { /** * @param {MessageTarget} target - The target for this message to be sent to * @param {MessageOptions|WebhookMessageOptions} options - Options passed in from send @@ -31,7 +31,7 @@ class APIMessage { /** * Data sendable to the API - * @type {?APIMessageRaw} + * @type {?APIMessage} */ this.data = null; @@ -119,7 +119,7 @@ class APIMessage { /** * Resolves data. - * @returns {APIMessage} + * @returns {MessagePayload} */ resolveData() { if (this.data) return this; @@ -202,7 +202,7 @@ class APIMessage { /** * Resolves files. - * @returns {Promise} + * @returns {Promise} */ async resolveFiles() { if (this.files) return this; @@ -247,7 +247,7 @@ class APIMessage { } /** - * Creates an `APIMessage` from user-level arguments. + * Creates a `MessagePayload` from user-level arguments. * @param {MessageTarget} target Target to send to * @param {string|MessageOptions|WebhookMessageOptions} options Options or content to use * @param {MessageOptions|WebhookMessageOptions} [extra={}] - Extra options to add onto specified options @@ -261,7 +261,7 @@ class APIMessage { } } -module.exports = APIMessage; +module.exports = MessagePayload; /** * A target for a message. @@ -270,6 +270,6 @@ module.exports = APIMessage; */ /** - * @external APIMessageRaw + * @external APIMessage * @see {@link https://discord.com/developers/docs/resources/channel#message-object} */ diff --git a/src/structures/Webhook.js b/src/structures/Webhook.js index 6c1a3e453..301edcd10 100644 --- a/src/structures/Webhook.js +++ b/src/structures/Webhook.js @@ -1,7 +1,7 @@ 'use strict'; -const APIMessage = require('./APIMessage'); const Channel = require('./Channel'); +const MessagePayload = require('./MessagePayload'); const { Error } = require('../errors'); const { WebhookTypes } = require('../util/Constants'); const DataResolver = require('../util/DataResolver'); @@ -109,8 +109,8 @@ class Webhook { /** * Sends a message with this webhook. - * @param {string|APIMessage|WebhookMessageOptions} options The options to provide - * @returns {Promise} + * @param {string|MessagePayload|WebhookMessageOptions} options The options to provide + * @returns {Promise} * @example * // Send a basic message * webhook.send('hello!') @@ -158,21 +158,21 @@ class Webhook { async send(options) { if (!this.token) throw new Error('WEBHOOK_TOKEN_UNAVAILABLE'); - let apiMessage; + let messagePayload; - if (options instanceof APIMessage) { - apiMessage = options.resolveData(); + if (options instanceof MessagePayload) { + messagePayload = options.resolveData(); } else { - apiMessage = APIMessage.create(this, options).resolveData(); + messagePayload = MessagePayload.create(this, options).resolveData(); } - const { data, files } = await apiMessage.resolveFiles(); + const { data, files } = await messagePayload.resolveFiles(); return this.client.api .webhooks(this.id, this.token) .post({ data, files, - query: { thread_id: apiMessage.options.threadID, wait: true }, + query: { thread_id: messagePayload.options.threadID, wait: true }, auth: false, }) .then(d => { @@ -247,7 +247,7 @@ class Webhook { * Gets a message that was sent by this webhook. * @param {Snowflake|'@original'} message The ID of the message to fetch * @param {boolean} [cache=true] Whether to cache the message - * @returns {Promise} Returns the raw message data if the webhook was instantiated as a + * @returns {Promise} Returns the raw message data if the webhook was instantiated as a * {@link WebhookClient} or if the channel is uncached, otherwise a {@link Message} will be returned */ async fetchMessage(message, cache = true) { @@ -260,19 +260,19 @@ class Webhook { /** * Edits a message that was sent by this webhook. * @param {MessageResolvable|'@original'} message The message to edit - * @param {string|APIMessage|WebhookEditMessageOptions} options The options to provide - * @returns {Promise} Returns the raw message data if the webhook was instantiated as a + * @param {string|MessagePayload|WebhookEditMessageOptions} options The options to provide + * @returns {Promise} Returns the raw message data if the webhook was instantiated as a * {@link WebhookClient} or if the channel is uncached, otherwise a {@link Message} will be returned */ async editMessage(message, options) { if (!this.token) throw new Error('WEBHOOK_TOKEN_UNAVAILABLE'); - let apiMessage; + let messagePayload; - if (options instanceof APIMessage) apiMessage = options; - else apiMessage = APIMessage.create(this, options); + if (options instanceof MessagePayload) messagePayload = options; + else messagePayload = MessagePayload.create(this, options); - const { data, files } = await apiMessage.resolveData().resolveFiles(); + const { data, files } = await messagePayload.resolveData().resolveFiles(); const d = await this.client.api .webhooks(this.id, this.token) diff --git a/src/structures/interfaces/InteractionResponses.js b/src/structures/interfaces/InteractionResponses.js index 3fed95fe8..5679f8d9a 100644 --- a/src/structures/interfaces/InteractionResponses.js +++ b/src/structures/interfaces/InteractionResponses.js @@ -3,7 +3,7 @@ const { Error } = require('../../errors'); const { InteractionResponseTypes } = require('../../util/Constants'); const MessageFlags = require('../../util/MessageFlags'); -const APIMessage = require('../APIMessage'); +const MessagePayload = require('../MessagePayload'); /** * Interface for classes that support shared interaction response types. @@ -53,7 +53,7 @@ class InteractionResponses { /** * Creates a reply to this interaction. - * @param {string|APIMessage|InteractionReplyOptions} options The options for the reply + * @param {string|MessagePayload|InteractionReplyOptions} options The options for the reply * @returns {Promise} * @example * // Reply to the interaction with an embed @@ -72,11 +72,11 @@ class InteractionResponses { if (this.deferred || this.replied) throw new Error('INTERACTION_ALREADY_REPLIED'); this.ephemeral = options.ephemeral ?? false; - let apiMessage; - if (options instanceof APIMessage) apiMessage = options; - else apiMessage = APIMessage.create(this, options); + let messagePayload; + if (options instanceof MessagePayload) messagePayload = options; + else messagePayload = MessagePayload.create(this, options); - const { data, files } = await apiMessage.resolveData().resolveFiles(); + const { data, files } = await messagePayload.resolveData().resolveFiles(); await this.client.api.interactions(this.id, this.token).callback.post({ data: { @@ -91,7 +91,7 @@ class InteractionResponses { /** * Fetches the initial reply to this interaction. * @see Webhook#fetchMessage - * @returns {Promise} + * @returns {Promise} * @example * // Fetch the reply to this interaction * interaction.fetchReply() @@ -106,8 +106,8 @@ class InteractionResponses { /** * Edits the initial reply to this interaction. * @see Webhook#editMessage - * @param {string|APIMessage|WebhookEditMessageOptions} options The new options for the message - * @returns {Promise} + * @param {string|MessagePayload|WebhookEditMessageOptions} options The new options for the message + * @returns {Promise} * @example * // Edit the reply to this interaction * interaction.editReply('New content') @@ -138,8 +138,8 @@ class InteractionResponses { /** * Send a follow-up message to this interaction. - * @param {string|APIMessage|InteractionReplyOptions} options The options for the reply - * @returns {Promise} + * @param {string|MessagePayload|InteractionReplyOptions} options The options for the reply + * @returns {Promise} */ followUp(options) { return this.webhook.send(options); @@ -166,7 +166,7 @@ class InteractionResponses { /** * Updates the original message whose button was pressed - * @param {string|APIMessage|WebhookEditMessageOptions} options The options for the reply + * @param {string|MessagePayload|WebhookEditMessageOptions} options The options for the reply * @returns {Promise} * @example * // Remove the components from the message @@ -180,11 +180,11 @@ class InteractionResponses { async update(options) { if (this.deferred || this.replied) throw new Error('INTERACTION_ALREADY_REPLIED'); - let apiMessage; - if (options instanceof APIMessage) apiMessage = options; - else apiMessage = APIMessage.create(this, options); + let messagePayload; + if (options instanceof MessagePayload) messagePayload = options; + else messagePayload = MessagePayload.create(this, options); - const { data, files } = await apiMessage.resolveData().resolveFiles(); + const { data, files } = await messagePayload.resolveData().resolveFiles(); await this.client.api.interactions(this.id, this.token).callback.post({ data: { diff --git a/src/structures/interfaces/TextBasedChannel.js b/src/structures/interfaces/TextBasedChannel.js index 87196e990..cc471068d 100644 --- a/src/structures/interfaces/TextBasedChannel.js +++ b/src/structures/interfaces/TextBasedChannel.js @@ -2,7 +2,7 @@ /* eslint-disable import/order */ const MessageCollector = require('../MessageCollector'); -const APIMessage = require('../APIMessage'); +const MessagePayload = require('../MessagePayload'); const SnowflakeUtil = require('../../util/SnowflakeUtil'); const Collection = require('../../util/Collection'); const { RangeError, TypeError, Error } = require('../../errors'); @@ -105,7 +105,7 @@ class TextBasedChannel { /** * Sends a message to this channel. - * @param {string|APIMessage|MessageOptions} options The options to provide + * @param {string|MessagePayload|MessageOptions} options The options to provide * @returns {Promise} * @example * // Send a basic message @@ -156,15 +156,15 @@ class TextBasedChannel { return this.createDM().then(dm => dm.send(options)); } - let apiMessage; + let messagePayload; - if (options instanceof APIMessage) { - apiMessage = options.resolveData(); + if (options instanceof MessagePayload) { + messagePayload = options.resolveData(); } else { - apiMessage = APIMessage.create(this, options).resolveData(); + messagePayload = MessagePayload.create(this, options).resolveData(); } - const { data, files } = await apiMessage.resolveFiles(); + const { data, files } = await messagePayload.resolveFiles(); return this.client.api.channels[this.id].messages .post({ data, files }) .then(d => this.client.actions.MessageCreate.handle(d).message); diff --git a/typings/index.d.ts b/typings/index.d.ts index b08ffd7bb..6e1ce6302 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -139,17 +139,17 @@ declare module 'discord.js' { import BaseCollection from '@discordjs/collection'; import { ChildProcess } from 'child_process'; import { - APIActionRowComponent as RawActionRowComponent, - APIInteractionDataResolvedChannel as RawInteractionDataResolvedChannel, - APIInteractionDataResolvedGuildMember as RawInteractionDataResolvedGuildMember, - APIInteractionGuildMember as RawInteractionGuildMember, - APIMessage as RawMessage, - APIMessageComponent as RawMessageComponent, - APIOverwrite as RawOverwrite, - APIPartialEmoji as RawEmoji, - APIRole as RawRole, - Snowflake as APISnowflake, + APIActionRowComponent, + APIInteractionDataResolvedChannel, + APIInteractionDataResolvedGuildMember, + APIInteractionGuildMember, + APIMessage, + APIMessageComponent, + APIOverwrite, + APIPartialEmoji, + APIRole, APIUser, + Snowflake as APISnowflake, ApplicationCommandOptionType as ApplicationCommandOptionTypes, ApplicationCommandPermissionType as ApplicationCommandPermissionTypes, } from 'discord-api-types/v8'; @@ -209,7 +209,7 @@ declare module 'discord.js' { public splashURL(options?: StaticImageURLOptions): string | null; } - export class APIMessage { + export class MessagePayload { constructor(target: MessageTarget, options: MessageOptions | WebhookMessageOptions); public data: unknown | null; public readonly isUser: boolean; @@ -225,7 +225,7 @@ declare module 'discord.js' { target: MessageTarget, options: string | MessageOptions | WebhookMessageOptions, extra?: MessageOptions | WebhookMessageOptions, - ): APIMessage; + ): MessagePayload; public static resolveFile(fileLike: BufferResolvable | Stream | FileOptions | MessageAttachment): Promise; public makeContent(): string | undefined; @@ -524,10 +524,10 @@ declare module 'discord.js' { public webhook: InteractionWebhook; public defer(options?: InteractionDeferOptions): Promise; public deleteReply(): Promise; - public editReply(options: string | APIMessage | WebhookEditMessageOptions): Promise; - public fetchReply(): Promise; - public followUp(options: string | APIMessage | InteractionReplyOptions): Promise; - public reply(options: string | APIMessage | InteractionReplyOptions): Promise; + public editReply(options: string | MessagePayload | WebhookEditMessageOptions): Promise; + public fetchReply(): Promise; + public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise; + public reply(options: string | MessagePayload | InteractionReplyOptions): Promise; private transformOption(option: unknown, resolved: unknown): CommandInteractionOption; private _createOptionsCollection(options: unknown, resolved: unknown): Collection; } @@ -1171,7 +1171,7 @@ declare module 'discord.js' { public readonly guild: Guild | null; public guildID: Snowflake | null; public id: Snowflake; - public member: GuildMember | RawInteractionGuildMember | null; + public member: GuildMember | APIInteractionGuildMember | null; public readonly token: string; public type: InteractionType; public user: User; @@ -1185,7 +1185,7 @@ declare module 'discord.js' { export class InteractionWebhook extends PartialWebhookMixin() { constructor(client: Client, id: Snowflake, token: string); public token: string; - public send(options: string | APIMessage | InteractionReplyOptions): Promise; + public send(options: string | MessagePayload | InteractionReplyOptions): Promise; } export class Invite extends Base { @@ -1283,7 +1283,7 @@ declare module 'discord.js' { options?: MessageComponentInteractionCollectorOptions, ): MessageComponentInteractionCollector; public delete(): Promise; - public edit(content: string | MessageEditOptions | APIMessage): Promise; + public edit(content: string | MessageEditOptions | MessagePayload): Promise; public equals(message: Message, rawData: unknown): boolean; public fetchReference(): Promise; public fetchWebhook(): Promise; @@ -1292,7 +1292,7 @@ declare module 'discord.js' { public pin(): Promise; public react(emoji: EmojiIdentifierResolvable): Promise; public removeAttachments(): Promise; - public reply(options: string | APIMessage | ReplyMessageOptions): Promise; + public reply(options: string | MessagePayload | ReplyMessageOptions): Promise; public startThread( name: string, autoArchiveDuration: ThreadAutoArchiveDuration, @@ -1341,7 +1341,7 @@ declare module 'discord.js' { constructor(data?: MessageButton | MessageButtonOptions); public customID: string | null; public disabled: boolean; - public emoji: RawEmoji | null; + public emoji: APIPartialEmoji | null; public label: string | null; public style: MessageButtonStyle | null; public type: 'BUTTON'; @@ -1377,17 +1377,17 @@ declare module 'discord.js' { public customID: string; public deferred: boolean; public ephemeral: boolean | null; - public message: Message | RawMessage; + public message: Message | APIMessage; public replied: boolean; public webhook: InteractionWebhook; public defer(options?: InteractionDeferOptions): Promise; public deferUpdate(): Promise; public deleteReply(): Promise; - public editReply(options: string | APIMessage | WebhookEditMessageOptions): Promise; - public fetchReply(): Promise; - public followUp(options: string | APIMessage | InteractionReplyOptions): Promise; - public reply(options: string | APIMessage | InteractionReplyOptions): Promise; - public update(content: string | APIMessage | WebhookEditMessageOptions): Promise; + public editReply(options: string | MessagePayload | WebhookEditMessageOptions): Promise; + public fetchReply(): Promise; + public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise; + public reply(options: string | MessagePayload | InteractionReplyOptions): Promise; + public update(content: string | MessagePayload | WebhookEditMessageOptions): Promise; public static resolveType(type: MessageComponentTypeResolvable): MessageComponentType; } @@ -1587,7 +1587,7 @@ declare module 'discord.js' { options: PermissionOverwriteOptions, initialPermissions: { allow?: PermissionResolvable; deny?: PermissionResolvable }, ): ResolvedOverwriteOptions; - public static resolve(overwrite: OverwriteResolvable, guild: Guild): RawOverwrite; + public static resolve(overwrite: OverwriteResolvable, guild: Guild): APIOverwrite; } export class Permissions extends BitField { @@ -2026,7 +2026,7 @@ declare module 'discord.js' { public static moveElementInArray(array: any[], element: any, newIndex: number, offset?: boolean): number; public static parseEmoji(text: string): { animated: boolean; name: string; id: Snowflake | null } | null; public static resolveColor(color: ColorResolvable): number; - public static resolvePartialEmoji(emoji: EmojiIdentifierResolvable): Partial | null; + public static resolvePartialEmoji(emoji: EmojiIdentifierResolvable): Partial | null; public static verifyString(data: string, error?: typeof Error, errorMessage?: string, allowEmpty?: boolean): string; public static setPosition( item: T, @@ -2122,10 +2122,10 @@ declare module 'discord.js' { public token: string; public editMessage( message: MessageResolvable, - options: string | APIMessage | WebhookEditMessageOptions, + options: string | MessagePayload | WebhookEditMessageOptions, ): Promise; public fetchMessage(message: Snowflake, cache?: boolean): Promise; - public send(options: string | APIMessage | WebhookMessageOptions): Promise; + public send(options: string | MessagePayload | WebhookMessageOptions): Promise; } export class WebSocketManager extends EventEmitter { @@ -2480,7 +2480,7 @@ declare module 'discord.js' { public cache: Collection; public crosspost(message: MessageResolvable): Promise; public delete(message: MessageResolvable): Promise; - public edit(message: MessageResolvable, options: APIMessage | MessageEditOptions): Promise; + public edit(message: MessageResolvable, options: MessagePayload | MessageEditOptions): Promise; public fetch(message: Snowflake, options?: BaseFetchOptions): Promise; public fetch( options?: ChannelLogsQueryOptions, @@ -2587,7 +2587,7 @@ declare module 'discord.js' { interface PartialTextBasedChannelFields { lastMessageID: Snowflake | null; readonly lastMessage: Message | null; - send(options: string | APIMessage | MessageOptions): Promise; + send(options: string | MessagePayload | MessageOptions): Promise; } interface TextBasedChannelFields extends PartialTextBasedChannelFields { @@ -2623,10 +2623,10 @@ declare module 'discord.js' { deleteMessage(message: MessageResolvable | '@original'): Promise; editMessage( message: MessageResolvable | '@original', - options: string | APIMessage | WebhookEditMessageOptions, + options: string | MessagePayload | WebhookEditMessageOptions, ): Promise; fetchMessage(message: Snowflake | '@original', cache?: boolean): Promise; - send(options: string | APIMessage | WebhookMessageOptions): Promise; + send(options: string | MessagePayload | WebhookMessageOptions): Promise; } interface WebhookFields extends PartialWebhookFields { @@ -3095,9 +3095,9 @@ declare module 'discord.js' { value?: string | number | boolean; options?: Collection; user?: User; - member?: GuildMember | RawInteractionDataResolvedGuildMember; - channel?: GuildChannel | RawInteractionDataResolvedChannel; - role?: Role | RawRole; + member?: GuildMember | APIInteractionDataResolvedGuildMember; + channel?: GuildChannel | APIInteractionDataResolvedChannel; + role?: Role | APIRole; } interface CreateRoleOptions extends RoleData { @@ -3776,7 +3776,7 @@ declare module 'discord.js' { interface MessageSelectOption { default: boolean; description: string | null; - emoji: RawEmoji | null; + emoji: APIPartialEmoji | null; label: string; value: string; }