new command format

This commit is contained in:
Emily 2020-10-21 11:38:40 +11:00
parent a5c7aaef5f
commit b898f170e7
2 changed files with 22 additions and 23 deletions

View file

@ -1,23 +0,0 @@
class Command {
constructor (client, {
name = null,
description = 'No description provided.',
category = 'Miscellaneous',
usage = 'No usage provided.',
parameters = '',
examples = '',
enabled = true,
guildOnly = false,
devOnly = false,
aliases = new Array(),
userPerms = new Array(),
botPerms = new Array (),
cooldown = 2000
}) {
this.client = client;
this.conf = { enabled, guildOnly, devOnly, aliases, userPerms, botPerms, cooldown };
this.help = { name, description, category, usage, parameters, examples };
}
}
module.exports = Command;

View file

@ -0,0 +1,22 @@
module.exports = class {
constructor (name, category) {
this.name = name,
this.category = category,
this.enabled = true,
this.guildOnly = false,
this.devOnly = false,
this.aliases = [],
this.userPerms = [],
this.botPerms = [],
this.cooldown = 2000,
this.help = {
description: 'Say hi!',
usage: 'hello',
examples: null
};
}
run (client, message, args, data) { // eslint-disable-line no-unused-vars
return client.createMessage(message.channel.id, `Hello, ${message.author}!`);
}
};