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
});
Was this page helpful?