mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
docs: fetchReply info + example (#6753)
This commit is contained in:
@@ -69,18 +69,19 @@ class InteractionResponses {
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @returns {Promise<Message|APIMessage|void>}
|
||||
* @example
|
||||
* // Reply to the interaction with an embed
|
||||
* // Reply to the interaction and fetch the response
|
||||
* const embed = new MessageEmbed().setDescription('Pong!');
|
||||
*
|
||||
* interaction.reply({ embeds: [embed] })
|
||||
* .then(() => console.log('Reply sent.'))
|
||||
* interaction.reply({ content: 'Pong!', fetchReply: true })
|
||||
* .then((message) => console.log(`Reply sent with content ${message.content}`))
|
||||
* .catch(console.error);
|
||||
* @example
|
||||
* // Create an ephemeral reply
|
||||
* interaction.reply({ content: 'Pong!', ephemeral: true })
|
||||
* // Create an ephemeral reply with an embed
|
||||
* interaction.reply({ embeds: [embed], ephemeral: true })
|
||||
* .then(() => console.log('Reply sent.'))
|
||||
* .catch(console.error);
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user