permission | bitfield invalid

if (!permissions.has("VIEW_CHANNEL")) {
interaction.reply("Channel has to be viewable to everyone.");
return;
if (!permissions.has("VIEW_CHANNEL")) {
interaction.reply("Channel has to be viewable to everyone.");
return;
gives me the error:
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: VIEW_CHANNEL.
at Function.resolve (/home/container/node_modules/discord.js/src/util/BitField.js:172:11)
at PermissionsBitField.has (/home/container/node_modules/discord.js/src/util/BitField.js:60:28)
at PermissionsBitField.has (/home/container/node_modules/discord.js/src/util/PermissionsBitField.js:92:82)
at Object.execute (/home/container/src/commands/setup.js:49:22)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'BitFieldInvalid'
}
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: VIEW_CHANNEL.
at Function.resolve (/home/container/node_modules/discord.js/src/util/BitField.js:172:11)
at PermissionsBitField.has (/home/container/node_modules/discord.js/src/util/BitField.js:60:28)
at PermissionsBitField.has (/home/container/node_modules/discord.js/src/util/PermissionsBitField.js:92:82)
at Object.execute (/home/container/src/commands/setup.js:49:22)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'BitFieldInvalid'
}
3 Replies
d.js toolkit
d.js toolkit13mo 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
d.js docs
d.js docs13mo ago
Tag suggestion for @Cgx: RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined - All SCREAMING_SNAKE_CASE enums have been changed to PascalCase - Intents: Intents.FLAGS.GUILD_MESSAGES -> GatewayIntentBits.GuildMessages - Permissions: Permissions.FLAGS.SEND_MESSAGES -> PermissionFlagsBits.SendMessages
Cgx
CgxOP13mo ago
Perfect, thanks!
Want results from more Discord servers?
Add your server