mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 15:57:50 +02:00
Add examples
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user