Error [ApplicationCommandPermissionsTokenMissing]: Editing application command permissions requires

await guild.commands.permissions.add({
command : '1277387223595089932',
permissions: [
{
id: '1277347927500652647',
type : 'ROLE',
permission: true,
}
]
})
await guild.commands.permissions.add({
command : '1277387223595089932',
permissions: [
{
id: '1277347927500652647',
type : 'ROLE',
permission: true,
}
]
})
When trying to use this code it says "Error [ApplicationCommandPermissionsTokenMissing]: Editing application command permissions requires an OAuth2 bearer token, but none was provided." Where do I put the bearer token in?
11 Replies
d.js toolkit
d.js toolkit6mo 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!
Mark
Mark6mo ago
Correct, only guild admins can set that unless they authorize the bot with ouath2
Stie (old account)
Stie (old account)OP6mo ago
I don't want to make my bot public. And I am the guild admin.
Mark
Mark6mo ago
Then you need to grant it access with oauth2 or set it yourself as the admin
Stie (old account)
Stie (old account)OP6mo ago
It is an admin. It has admin permissions When first authorizing it I gave it admin
Mark
Mark6mo ago
Permissions is not the same as oauth2 This is not something that discord exposes to the normal bot API, it explicitly says a user admin has to do it or grant the bot the access to do it via oauth2
Stie (old account)
Stie (old account)OP6mo ago
I did the OAuth2 URL Generator to get it onto my server. How else am I supposed to do it? I picked bot and Administrator
Mark
Mark6mo ago
I suggest you ask in ddevs in #useful-servers as d.js does not have support for oauth2
Stie (old account)
Stie (old account)OP6mo ago
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
Stie (old account)
Stie (old account)OP6mo ago
They do..
Mark
Mark6mo ago
Where is there any d.js code on that page That's like saying databases or pm2 are related to d.js because the guide has a page on how to use them

Did you find this page helpful?