FAQs/tags/canned responses

This commit is contained in:
Isaac
2021-05-18 22:08:49 +01:00
parent f40fabfbf3
commit c03a32dbb4
5 changed files with 154 additions and 9 deletions

View File

@@ -117,7 +117,7 @@ module.exports = class Command {
* Send a message with the command usage
* @param {TextChannel} channel - The channel to send the message to
* @param {string} [alias] - The command alias
* @returns {Message}
* @returns {Promise<Message>}
*/
async sendUsage(channel, alias) {
const settings = await channel.guild.settings;

View File

@@ -176,7 +176,7 @@ module.exports = class CommandManager {
}
}
} else {
const args_num = raw_args.split(' ').filter(arg => arg.length !== 0).length; // count the number of single-word args were given
const args_num = raw_args.split(/\s/g).filter(arg => arg.length !== 0).length; // count the number of single-word args were given
const required_args = cmd.args.reduce((acc, arg) => arg.required ? acc + 1 : acc, 0); // count how many of the args are required
if (args_num < required_args) {
return await cmd.sendUsage(message.channel, cmd_name);