docs: fetchReply info + example (#6753)

This commit is contained in:
Souji
2021-10-05 01:37:04 +02:00
committed by GitHub
parent ba93e85d0d
commit 8bc1ece98e

View File

@@ -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);
*/