mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Auto-add - aliases
This commit is contained in:
@@ -18,6 +18,11 @@ module.exports = class Registry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
registerCommand(command) {
|
registerCommand(command) {
|
||||||
|
for (const alias of command.aliases) {
|
||||||
|
const replaced = alias.replace(/-/g, '');
|
||||||
|
if (replaced === alias) continue;
|
||||||
|
command.aliases.push(replaced);
|
||||||
|
}
|
||||||
this.commands.set(command.name, command);
|
this.commands.set(command.name, command);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user