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
d.js toolkit
d.js toolkit14mo 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!
d.js docs
d.js docs14mo ago
Documentation suggestion for @NotDemonix:method PermissionsBitField#has() Checks whether the bitfield has a permission, or multiple permissions.
NotDemonix
NotDemonixOP14mo ago
@Squid do I input an array or spread the array?
Squid
Squid14mo ago
if the docs don't include ... before the type, you don't have to spread it
NotDemonix
NotDemonixOP14mo ago
Is there a function that lets me know which permissions are missing? Or should I use .has in a loop
d.js docs
d.js docs14mo ago
class 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.
Squid
Squid14mo ago
ctrl+F for the word "missing"
NotDemonix
NotDemonixOP14mo ago
lil confused but k
Want results from more Discord servers?
Add your server