Unable to change USE_EXTERNAL_APPS permission

Hello, I am trying to change the USE_EXTERNAL_APPS permission for a role in a channel. However I am encountering an issue. Below is the code and the error message. It's been some time since I did anything with discord.js so I may just be misremembering the process. Code
const channels = interaction.guild.channels.cache;
channels.forEach(channel => {
channel.permissionOverwrites.edit(`212635560596996097`, { USE_EXTERNAL_APPS: false });
});
return interaction.reply({ content: 'Permissions updated.', ephemeral: true });
const channels = interaction.guild.channels.cache;
channels.forEach(channel => {
channel.permissionOverwrites.edit(`212635560596996097`, { USE_EXTERNAL_APPS: false });
});
return interaction.reply({ content: 'Permissions updated.', ephemeral: true });
Error
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: USE_EXTERNAL_APPS.
at PermissionsBitField.resolve (C:\Users\dedicated\Desktop\DiscordBot\node_modules\discord.js\src\util\BitField.js:174:11)
at PermissionsBitField.remove (C:\Users\dedicated\Desktop\DiscordBot\node_modules\discord.js\src\util\BitField.js:105:33)
at PermissionOverwrites.resolveOverwriteOptions (C:\Users\dedicated\Desktop\DiscordBot\node_modules\discord.js\src\structures\PermissionOverwrites.js:130:15)
at PermissionOverwriteManager.upsert (C:\Users\dedicated\Desktop\DiscordBot\node_modules\discord.js\src\managers\PermissionOverwriteManager.js:105:50)
at PermissionOverwriteManager.edit (C:\Users\dedicated\Desktop\DiscordBot\node_modules\discord.js\src\managers\PermissionOverwriteManager.js:150:17)
at C:\Users\dedicated\Desktop\DiscordBot\commands\Moderator\permission.js:14:42
at _Collection.forEach (<anonymous>)
at Object.execute (C:\Users\dedicated\Desktop\DiscordBot\commands\Moderator\permission.js:13:18)
at Object.execute (C:\Users\dedicated\Desktop\DiscordBot\events\interactionCreate.js:14:31)
at Client.<anonymous> (C:\Users\dedicated\Desktop\DiscordBot\functions\handleEvents.js:8:58) {
code: 'BitFieldInvalid'
}
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: USE_EXTERNAL_APPS.
at PermissionsBitField.resolve (C:\Users\dedicated\Desktop\DiscordBot\node_modules\discord.js\src\util\BitField.js:174:11)
at PermissionsBitField.remove (C:\Users\dedicated\Desktop\DiscordBot\node_modules\discord.js\src\util\BitField.js:105:33)
at PermissionOverwrites.resolveOverwriteOptions (C:\Users\dedicated\Desktop\DiscordBot\node_modules\discord.js\src\structures\PermissionOverwrites.js:130:15)
at PermissionOverwriteManager.upsert (C:\Users\dedicated\Desktop\DiscordBot\node_modules\discord.js\src\managers\PermissionOverwriteManager.js:105:50)
at PermissionOverwriteManager.edit (C:\Users\dedicated\Desktop\DiscordBot\node_modules\discord.js\src\managers\PermissionOverwriteManager.js:150:17)
at C:\Users\dedicated\Desktop\DiscordBot\commands\Moderator\permission.js:14:42
at _Collection.forEach (<anonymous>)
at Object.execute (C:\Users\dedicated\Desktop\DiscordBot\commands\Moderator\permission.js:13:18)
at Object.execute (C:\Users\dedicated\Desktop\DiscordBot\events\interactionCreate.js:14:31)
at Client.<anonymous> (C:\Users\dedicated\Desktop\DiscordBot\functions\handleEvents.js:8:58) {
code: 'BitFieldInvalid'
}
npm ls discord-api-types https://i.imgur.com/2QGQCIb.png Node.js is v21.6.0
Imgur
11 Replies
d.js toolkit
d.js toolkit4mo 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
monbrey
monbrey4mo ago
14.14.1 is an old version of discord.js, please update and see if that resolves your issue
Gravvy
GravvyOP4mo ago
Give me just a moment
Gravvy
GravvyOP4mo ago
Same error after updating https://i.imgur.com/JHs6ayT.png
Imgur
monbrey
monbrey4mo ago
Actually shouldnt it be UseExternalApps We use PascalCase for things
Gravvy
GravvyOP4mo ago
Oh yeah Turns out, gives the same error
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
monbrey
monbrey4mo ago
Ahh there you go, my bad
Gravvy
GravvyOP4mo ago
Damn alright. I was hoping. Well I'll store this away for a rainy day when it is pushed out to the public
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
Gravvy
GravvyOP4mo ago
Thank you very much, looking forward to it
Want results from more Discord servers?
Add your server