appujet / lavamusic

lavalink music bot base in lavalink-client and discord.js v14
https://appujet.github.io/lavamusic/
GNU General Public License v3.0
569 stars 494 forks source link

slash commands not getting set up #285

Closed Donad678 closed 2 years ago

Donad678 commented 2 years ago

I'm using the docker install version and every time the bot starts its showing this error in the logs and it doesn't register any slash commands. Commands through the prefix still work fine.

DiscordAPIError[20001]: Bots cannot use this endpoint
    at SequentialHandler.runRequest (/opt/lavamusic/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.cjs:293:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (/opt/lavamusic/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.cjs:99:14)
    at async REST.request (/opt/lavamusic/node_modules/@discordjs/rest/dist/lib/REST.cjs:52:22)
    at async /opt/lavamusic/src/handlers/slashCommand.js:51:7 {
  rawError: { message: 'Bots cannot use this endpoint', code: 20001 },
  code: 20001,
  status: 403,
  method: 'PUT',
  url: 'https://discord.com/api/v10/applications//commands',
  requestBody: {
    files: undefined,
    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]
    ]
  }
}
Xenofic commented 2 years ago

This is not a bug you just have to add your bot's id on config.js in the clientID field

Donad678 commented 2 years ago

ah ok, thank you. There was no field for that in the docker-compose file so I didn't think about that. Added the CLIENT_ID Environment variable to the docker-compose.yml under lavamusic and now it works. I'm gonna close this then