Permission Checks

Is there any like suggested way to make permission checks? I have been doing fetch with force set to true to make sure that the person who executes certain command still possesses HR command but then again, is it the way I should do it since I don't want to send lots of requests.
7 Replies
d.js toolkit
d.js toolkit•4mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - ✅ Marked as resolved by OP
Mark
Mark•4mo ago
The member data who uses the command should be sent with the interaction or message and fetching shouldn't be necessary in most cases if you have the guilds intent and don't mess with cache
d.js docs
d.js docs•4mo ago
:property: ChatInputCommandInteraction#memberPermissions @14.15.3 The permissions of the member, if one exists, in the channel this interaction was executed in
Mark
Mark•4mo ago
Oh even better!
Shrewd 💫
Shrewd 💫OP•4mo ago
yes but I'm checking it by role id And let's say he has hr role And if it gets removed, it wont figure out he doesnt have this role until I simply fetch it
Mark
Mark•4mo ago
you'd need the guildmember intent to receive the updated data automatically without needing it to be fetched
Shrewd 💫
Shrewd 💫OP•4mo ago
let me see is it guildmembers seems like it is i'll test it now Alright works, thank youu
Want results from more Discord servers?
Add your server