Skip to content

Commit

Permalink
fix a totally harmless feature
Browse files Browse the repository at this point in the history
  • Loading branch information
taranvohra committed Apr 8, 2024
1 parent 95022e8 commit f851e34
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/features/troll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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");
}
Expand Down

0 comments on commit f851e34

Please sign in to comment.