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
- 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 OPThe 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
:property: ChatInputCommandInteraction#memberPermissions
@14.15.3
The permissions of the member, if one exists, in the channel this interaction was executed inOh even better!
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
you'd need the guildmember intent to receive the updated data automatically without needing it to be fetched
let me see
is it guildmembers
seems like it is
i'll test it now
Alright works, thank youu