From 5d29e7f78e6ea06271b69ef3e1c56f15b1b8641f Mon Sep 17 00:00:00 2001 From: Ninjdai1 Date: Sun, 10 Sep 2023 22:37:15 +0200 Subject: [PATCH] Allow /say to reply to an existing message --- commands/misc/say.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commands/misc/say.js b/commands/misc/say.js index 14a2b89..41eb602 100644 --- a/commands/misc/say.js +++ b/commands/misc/say.js @@ -12,6 +12,10 @@ module.exports = { .addChannelOption(option => option.setName('destination') .setDescription('Sélectionnez le salon où envoyer le message!') + .setRequired(false)) + .addStringOption(option => + option.setName('reply') + .setDescription('Id du message auquel répondre!') .setRequired(false)), async execute(interaction) { let msgtosend = interaction.options.getString('message'); @@ -22,8 +26,10 @@ module.exports = { channeltosend = interaction.channel } + const replyMessageId = interaction.options.getString('reply') || null; + try { - channeltosend.send(msgtosend) + channeltosend.send({ content: msgtosend, reply: { messageReference: replyMessageId }}) await interaction.reply({ content: "Message envoyé !", ephemeral: true