mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-04 09:21:25 +03:00
FAQs/tags/canned responses
This commit is contained in:
@@ -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;
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user