我正在将我的命令从 vanilla discord.js 移植到 commando 框架。我有一个命令,当参数丢失时,它会警告用户。
const { Command } = require('discord.js-commando');
module.exports = class ServerCommand extends Command {
constructor(client) {
super(client, {
name: 'say',
aliases: ['s'],
group: 'mod',
memberName: 'say',
description: 'Make the bot speak for you.',
userPermissions: ['MANAGE_CHANNELS'],
examples: [client.commandPrefix + 'say <text>',client.commandPrefix + 'say hello world'],
args: [{
key: 'text',
prompt: 'What should the bot say?',
type: 'string',
}]
})
}
run(message, { text }) {
if (text == '' || !text)
message.say("You didn't specify what the bot should say.")
message.say(text);
message.delete();
}
}
现在,使用 commando 时,它会在缺少 arg 时自动向用户发出回复警告。我的问题是,我怎样才能覆盖它?
提前致谢!