Problems with setting command permissions using bearer token

I'm having troubles with setting command permissions using a bearer token. On my website, there's an authorisation system with the npm package passport-discord. This gives me an accessToken. When I try to set the command permissions using that token, it gives me the following error: DiscordAPIError[50026]: Missing required OAuth2 scope. I don't know what I'm doing wrong at this moment. Code:
const cmd = await guild.commands.create(commandsData);
cmd.permissions.set({
token: req.user.accessToken,
permissions: rolePermissions
});
const cmd = await guild.commands.create(commandsData);
cmd.permissions.set({
token: req.user.accessToken,
permissions: rolePermissions
});
2 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SirNuny
SirNunyOP2y ago
You're right, I'll try that. Thanks for your response I added applications.commands.permissions.update to the scopes but it's still giving me the error DiscordAPIError[0]: 401: Unauthorized Oh okay, then I'll look at the token Thanks a lot! It works fine now
Want results from more Discord servers?
Add your server