You can setup your command files to have aliases in them like this:
module.exports = {
name: 'command',
description: 'description',
aliases: ['cmd', 'another alias'],
execute(message, args) {
// ...
}
};
Then if you wanted to find a command by it's alias you can use:
client.commands.find(cmd => cmd.aliases.includes("an alias"));
You can find more about using aliases in this guide
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…