discord / discord-example-app

Basic Discord app with examples
MIT License
515 stars 525 forks source link

Unauthorized #14

Closed Dfredude closed 1 year ago

Dfredude commented 1 year ago

I get the following response when starting the app.js

Error: {"message":"401: Unauthorized","code":0}
    at DiscordRequest (file:///C:/Users/domin/Desktop/Projects/zen-discord-back-end-service/utils.js:37:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async HasGuildCommand (file:///C:/Users/domin/Desktop/Projects/zen-discord-back-end-service/commands.js:17:17)

I've been for hours trying to find out what the issue is. I've even been using Postman and console logged the environment variables and they are correct (I think). Is the Discord token supposed to be in this format as un URI? discord.com/api/oauth2/authorize?client_id=&permissions=&scope=bot%20applications.commands

Dfredude commented 1 year ago

I'm stupid. I confused OAuth token URL with the Discord bot's Token!