kai 𓇢𓆸
DIAdiscord.js - Imagine an app
•Created by kai 𓇢𓆸 on 7/20/2024 in #djs-questions
Cannot read properties of undefined (reading 'roles')
I am trying to get the user's highest role and compare it to a role they are attemping to give another user through a slash command.
The command worked perfectly until I tried to add this checker, and now it's breaking.
The error I am getting is
TypeError: Cannot read properties of undefined (reading 'roles')
The line that is erroring is const senderHR = interaction.sender.roles.highest.position;
Full code:
57 replies