From f851e342417bc5340014f5e0f7588084008575e8 Mon Sep 17 00:00:00 2001 From: taranvohra Date: Mon, 8 Apr 2024 23:14:19 +0530 Subject: [PATCH] fix a totally harmless feature --- src/features/troll.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/features/troll.ts b/src/features/troll.ts index 35482ce2..0f9c6b81 100644 --- a/src/features/troll.ts +++ b/src/features/troll.ts @@ -8,12 +8,7 @@ const troll: ChannelHandlers = { ? await maybeMessage.fetch() : maybeMessage; - if ( - msg.guild || - !isStaff(msg.member) || - !msg.content.startsWith("skillissue") - ) - return; + if (msg.guild || !msg.content.startsWith("skillissue")) return; const [, messageLink] = msg.content.split(" "); const [guildId, channelId, messageId] = new URL(messageLink).pathname @@ -22,7 +17,12 @@ const troll: ChannelHandlers = { const guild = await bot.guilds.fetch(guildId); const channel = await guild.channels.fetch(channelId); - if (channel && channel.type === ChannelType.GuildText) { + const guildMember = await guild.members.fetch(msg.author.id); + if ( + isStaff(guildMember) && + channel && + channel.type === ChannelType.GuildText + ) { const message = await channel.messages.fetch(messageId); await message.reply("skill issue"); }