Add examples

This commit is contained in:
Dragon Fire
2024-05-16 17:16:00 -04:00
parent 9d00180cb3
commit 986d5d90fb
28 changed files with 138 additions and 32 deletions
+11
View File
@@ -49,6 +49,17 @@ module.exports = class Command {
return `\`${this.client.commandPrefix}${this.name}${args}\` or \`@${this.client.user.tag} ${this.name}${args}\``;
}
example(msg) {
const args = this.args.map((arg, i) => {
const example = arg.example(msg, arg);
if (i !== args.length - 1 && example.includes(' ')) {
return `"${example}"`;
}
return example;
});
return `${this.client.commandPrefix}${this.name} ${args.join(' ')}`;
}
disable() {
this._enabled = false;
}