Allow /say to reply to an existing message

This commit is contained in:
Ninjdai1 2023-09-10 22:37:15 +02:00
parent 20667f34d5
commit 5d29e7f78e

View File

@ -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