Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在discord.js-Commando上禁用默认命令?_Javascript_Bots_Discord - Fatal编程技术网

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

Javascript 如何在discord.js-Commando上禁用默认命令?,javascript,bots,discord,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 nam

我想禁用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.

我偶然发现了这篇文章,发现它还没有得到答案。因此,我将分享一个答案

删除:

bot.registry.registerDefaultCommands({
help: false, 
prefix: false, 
ping: false,
_eval: false,
unknownCommand: true, 
commandState: true
})
删除此选项将删除所有默认命令,您可以在这些命令之后自由命名命令。如果您需要更多帮助,请回复此帖子