diff --git a/Xiao.js b/Xiao.js index ae172b3e..4b7f2a7b 100644 --- a/Xiao.js +++ b/Xiao.js @@ -276,7 +276,7 @@ client.on('guildCreate', async guild => { } if (guild.systemChannel && guild.systemChannel.permissionsFor(client.user).has(PermissionFlagsBits.SendMessages)) { try { - const usage = client.registry.commands.get('help').usage(true); + const usage = client.registry.commands.get('help').usage(''); await guild.systemChannel.send(`Hi! I'm Xiao, use ${usage} to see my commands, yes?`); } catch { // Nothing! diff --git a/framework/Command.js b/framework/Command.js index d91acf04..21a7498f 100644 --- a/framework/Command.js +++ b/framework/Command.js @@ -39,11 +39,11 @@ module.exports = class Command { return this.client.registry.groups.get(this.groupID); } - usage(noArgs = false) { - const args = noArgs ? '' : this.args + usage(forcedArgs) { + const args = typeof forcedArgs !== 'undefined' ? forcedArgs : this.args .map(arg => { const hasDefault = arg.default !== null; - return `${hasDefault ? '[' : '<'}${arg.label || arg.key}${hasDefault ? ']' : '>'}` + return `${hasDefault ? '[' : '<'}${arg.label || arg.key}${hasDefault ? ']' : '>'}`; }).join(' '); return `\`${this.client.commandPrefix}${this.name} ${args}\` or \`@${this.client.user.tag} ${this.name} ${args}\``; }