Following this; https://discordjs.guide/creating-your-bot/creating-commands.html#command-deployment-script
I'm trying to run node deploy-commands.js to register my commands to a single guild and I'm getting the following error.
C:\Users\\\\hello-world-discord-bot>node deploy-commands.js
DiscordAPIError[50001]: Missing Access
at SequentialHandler.runRequest (C:\\\\\hello-world-discord-bot\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js:198:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\\\\\hello-world-discord-bot\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js:99:20)
at async C:\\\\\hello-world-discord-bot\deploy-commands.js:17:3 {
rawError: { message: 'Missing Access', code: 50001 },
code: 50001,
status: 403,
method: 'put',
url: 'https://discord.com/api/v9/applications/877359061669118003/guilds/447125601757691915/commands'
}
I've tried removing the bot and re-permissioning it via the developer web console before re-adding it. I've checked and re-added the token clientId and guildId and I get the same error message every time. I can see it's not getting access but I've no idea where else access would be granted from.
My deploy-commands.js looks like this:
{
"clientId": "123456789012345678",
"guildId": "876543210987654321",
"token": "my-token-goes-here"
}