Permissions
Hey, I got an array like
["SendMessages", "ViewChannel"]
, how can I use BotMember.permissionsIn(channel)
with that array to check if it got all of them and if no then which?8 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!Documentation suggestion for @NotDemonix: PermissionsBitField#has()
Checks whether the bitfield has a permission, or multiple permissions.
@Squid do I input an array or spread the array?
if the docs don't include
...
before the type, you don't have to spread itIs there a function that lets me know which permissions are missing? Or should I use .has in a loop
PermissionsBitField (extends BitField)
Data structure that makes it easy to interact with a permission bitfield. All GuildMembers have a set of permissions in their guild, and each channel in the guild may also have PermissionOverwrites for the member that override their default permissions.
ctrl+F for the word "missing"
lil confused but k