5

I'm unable to register my slash commands using Discord.js, why?

 2 years ago
source link: https://dev.to/techpro424/im-unable-to-register-my-slash-commands-using-discordjs-why-4gfm
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
TechPro424

Posted on Dec 22

I'm unable to register my slash commands using Discord.js, why?

for (const guildId of guildIds) {
  client.application.commands.set(commands, guildId)
}

Enter fullscreen mode

Exit fullscreen mode

When I try to register my slash commands using this code, it logs all my commands and exits the process
For example:

{
        name: 'ytinfo',
        description: 'Gets information on a YouTube channel.',
        type: undefined,
        options: [
          {
            type: 3,
            name: 'link',
            description: 'The YouTube channel whose info to get.',
            required: true,
            autocomplete: undefined,
            choices: undefined,
            options: undefined,
            channel_types: undefined
          }
        ],
        default_permission: undefined
      },

Enter fullscreen mode

Exit fullscreen mode

The full log: https://gist.github.com/TechPro424/f0253e29d258c1b2548c32c9a1d10275


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK