如何在discord.js-Commando上禁用默认命令?

时间:2019-01-29 21:50:23

标签: javascript bots discord

我想禁用Commando随附的所有默认命令。我试图使用此代码,但每次都会出现相同的错误。

我已经尝试了相同代码的其他格式,但没有一种起作用。

bot.registry.registerDefaultCommands({
help: false, 
prefix: false, 
ping: false,
_eval: false,
unknownCommand: true, 
commandState: true
})


throw new Error(`A command with the name/alias "${command.name}" is already registered.`);
                            ^

Error: A command with the name/alias "eval" is already registered.

1 个答案:

答案 0 :(得分:0)

我偶然发现了这篇文章,发现它还没有答案。所以我会分享一个答案。

删除:

bot.registry.registerDefaultCommands({
help: false, 
prefix: false, 
ping: false,
_eval: false,
unknownCommand: true, 
commandState: true
})

删除此选项将删除所有默认命令,您可以在这些命令之后随意命名。如果您需要其他帮助,请回复此帖子。