Skip to content

Commit

Permalink
Oopsiee
Browse files Browse the repository at this point in the history
  • Loading branch information
maddymeows committed Apr 25, 2024
1 parent ef79260 commit 0835f33
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/commands/ReactionRoleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ export class ReactionRoleCommand extends Subcommand {
return
}

const role = interaction.options.getRole("role", true)
const role = interaction.guild!.roles.cache.get(
interaction.options.getRole("role", true).id,
)!

if (role.managed || interaction.guild!.roles.everyone.id === role.id) {
await interaction.editReply({
Expand All @@ -207,13 +209,12 @@ export class ReactionRoleCommand extends Subcommand {
return
}

for (const memberRole of interaction.member.roles) {
if (role.comparePositionTo(memberRole) >= 0) {
await interaction.editReply({
content: "This role is higher than your current highest role.",
})
return
}
const member = await interaction.guild!.members.fetch(interaction.user.id)
if (role.comparePositionTo(member.roles.highest) >= 0) {
await interaction.editReply({
content: "This role is higher than your current highest role.",
})
return
}

await message.react(emoji)
Expand Down

0 comments on commit 0835f33

Please sign in to comment.