mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
feat(CommandInteraction): ephemeral followup messages (#5618)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -187,6 +187,24 @@ class CommandInteraction extends Interaction {
|
||||
* @property {Role|Object} [role] The resolved role
|
||||
*/
|
||||
|
||||
/**
|
||||
* Send a follow-up message to this interaction.
|
||||
* @param {string|APIMessage|MessageAdditions} content The content for the reply
|
||||
* @param {InteractionReplyOptions} [options] Additional options for the reply
|
||||
* @returns {Promise<Message|Object>}
|
||||
*/
|
||||
async followUp(content, options) {
|
||||
const apiMessage = content instanceof APIMessage ? content : APIMessage.create(this, content, options);
|
||||
const { data, files } = await apiMessage.resolveData().resolveFiles();
|
||||
|
||||
const raw = await this.client.api.webhooks(this.applicationID, this.token).post({
|
||||
data,
|
||||
files,
|
||||
});
|
||||
|
||||
return this.channel?.messages.add(raw) ?? raw;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms an option received from the API.
|
||||
* @param {Object} option The received option
|
||||
|
||||
Reference in New Issue
Block a user