mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 06:42:50 +02:00
Add name alias
This commit is contained in:
@@ -18,6 +18,8 @@ module.exports = class Registry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
registerCommand(command) {
|
registerCommand(command) {
|
||||||
|
const nameReplaced = command.name.replace(/-/g, '');
|
||||||
|
if (nameReplaced !== command.name) command.aliases.push(nameReplaced);
|
||||||
for (const alias of command.aliases) {
|
for (const alias of command.aliases) {
|
||||||
const replaced = alias.replace(/-/g, '');
|
const replaced = alias.replace(/-/g, '');
|
||||||
if (replaced === alias) continue;
|
if (replaced === alias) continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user