discord.js-commando RangeError: Argument type "string" isn't registered

331 views Asked by At

I'm trying to disable default help and eval command in commando however, I get the following error:

RangeError: Argument type "string" isn't registered.

I registered discord.js-commando as client

That's the code that the error is from

client.registry.registerDefaultCommands({
    help: false,
    eval: false,
});
1

There are 1 answers

1
abisammy On

I looked on the documents and I figured out the problem. The issue is that you were only registering the default commands, but you also needed to register the default types and the default groups. Add these few lines of code to fix the problem:

    .registerDefaultTypes()
    .registerDefaultGroups()
    .registerDefaultCommands({
      // Put commands you dont want to use here
})

Read more about the issue here:https://discord.js.org/#/docs/commando/master/class/CommandoRegistry?scrollTo=registerDefaultCommands