aternosorg / modbot

An open source moderation bot with advanced features developed by Aternos.
MIT License
127 stars 61 forks source link

DiscordAPIError: Missing Access #482

Closed StoneMcYT closed 2 years ago

StoneMcYT commented 2 years ago

Does anyone know the possible causes of this issue?

pi@raspberrypi:~/Desktop/modbot $ node index.js
./commands/settings/PrefixCommand.js doesn't support slash commands!
./commands/user/DeleteCommandsCommand.js doesn't support slash commands!
./commands/utility/ImportCommand.js doesn't support slash commands!
Connected!
Loading slash commands!
DiscordAPIError: Missing Access
    at RequestHandler.execute (/home/pi/Desktop/modbot/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/home/pi/Desktop/modbot/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
    at async GuildApplicationCommandManager.set (/home/pi/Desktop/modbot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:146:18)
    at async Bot._loadSlashCommands (/home/pi/Desktop/modbot/src/Bot.js:134:13)
    at async Promise.all (index 2)
    at async Bot.start (/home/pi/Desktop/modbot/src/Bot.js:64:9) {
  method: 'put',
  path: '/applications/939187322476437525/guilds/702883639574396969/commands',
  code: 50001,
  httpStatus: 403,
  requestData: {
    json: [
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object]
    ],
    files: []
  }
}
pi@raspberrypi:~/Desktop/modbot $
MiataBoy commented 2 years ago

The bot needs to be invited with the application.commands scope for slash commands to work, otherwise this error will occur.

StoneMcYT commented 2 years ago

Its fixed. Thank you!