mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
docs: fetchReply info + example (#6753)
This commit is contained in:
@@ -69,18 +69,19 @@ class InteractionResponses {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a reply to this interaction.
|
* Creates a reply to this interaction.
|
||||||
|
* <info>Use the `fetchReply` option to get the bot's reply message.</info>
|
||||||
* @param {string|MessagePayload|InteractionReplyOptions} options The options for the reply
|
* @param {string|MessagePayload|InteractionReplyOptions} options The options for the reply
|
||||||
* @returns {Promise<Message|APIMessage|void>}
|
* @returns {Promise<Message|APIMessage|void>}
|
||||||
* @example
|
* @example
|
||||||
* // Reply to the interaction with an embed
|
* // Reply to the interaction and fetch the response
|
||||||
* const embed = new MessageEmbed().setDescription('Pong!');
|
* const embed = new MessageEmbed().setDescription('Pong!');
|
||||||
*
|
*
|
||||||
* interaction.reply({ embeds: [embed] })
|
* interaction.reply({ content: 'Pong!', fetchReply: true })
|
||||||
* .then(() => console.log('Reply sent.'))
|
* .then((message) => console.log(`Reply sent with content ${message.content}`))
|
||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
* @example
|
* @example
|
||||||
* // Create an ephemeral reply
|
* // Create an ephemeral reply with an embed
|
||||||
* interaction.reply({ content: 'Pong!', ephemeral: true })
|
* interaction.reply({ embeds: [embed], ephemeral: true })
|
||||||
* .then(() => console.log('Reply sent.'))
|
* .then(() => console.log('Reply sent.'))
|
||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user