From 4c289680489131c762a9e8d8d7005dec9d55ef80 Mon Sep 17 00:00:00 2001 From: Phil Date: Fri, 27 Sep 2024 11:43:06 +0200 Subject: [PATCH] fixes --- commands/red.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/red.js b/commands/red.js index eca2621..1d06590 100644 --- a/commands/red.js +++ b/commands/red.js @@ -7,11 +7,11 @@ module.exports.run = async (interaction) => { // prepare username, avatar and message const contentText = await interaction.channel.send(interaction.options.getString('message', true)).catch(ERR); - const username = message.member.nickname || message.author.username; - const avatarURL = message.member.displayAvatarURL({ format: 'png', dynamic: true, size: 512 }); + const username = interaction.message.member.nickname; + const avatarURL = interaction.message.member.displayAvatarURL({ format: 'png', dynamic: true, size: 512 }); // get webhook and send message - const channel = message.channel; + const channel = interaction.message.channel; const channelWebhooks = await channel.fetchWebhooks(); let hook = channelWebhooks.find((hook) => hook.owner.id === client.user.id); if (!hook) hook = await channel.createWebhook({ name: config.name }).catch(ERR);