From 226ae3b09604efa2fd3c429010bebfe35fb1f68c Mon Sep 17 00:00:00 2001 From: Supositware Date: Wed, 14 Sep 2022 11:30:45 +0200 Subject: [PATCH] Allow sending attachment --- commands/utility/feedback.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/commands/utility/feedback.js b/commands/utility/feedback.js index 6ed2e8c..9cf0c5d 100644 --- a/commands/utility/feedback.js +++ b/commands/utility/feedback.js @@ -10,7 +10,11 @@ export default { .addStringOption(option => option.setName('feedback') .setDescription('The message you want to send me.') - .setRequired(true)), + .setRequired(true)) + .addAttachmentOption(option => + option.setName('image') + .setDescription('Optional attachment.') + .setRequired(false)), category: 'utility', async execute(interaction, args) { const Embed = new EmbedBuilder() @@ -27,7 +31,12 @@ export default { } const channel = interaction.client.channels.resolve(feedbackChannelId); - channel.send({ embeds: [Embed] }); + if (args.image) { + channel.send({ embeds: [Embed], files: [args.image] }); + } + else { + channel.send({ embeds: [Embed] }); + } await interaction.reply({ content: 'Your feedback has been sent! Don\'t forget to have dm open if you want to get an answer from the dev!', ephemeral: true }); }, };