Closed tad-dufort closed 2 years ago
I don't think this would be beneficial to those that don't use aliases.
I don't think this would be beneficial to those that don't use aliases.
though it would for those who do use them and don't want to make 2 commands and copy the code
Why not just use the aliases as they are in slappey today?
Why not just use the aliases as they are in slappey today?
there are aliases already? how do you use them
Why not just use the aliases as they are in slappey today?
there are aliases already? how do you use them
Yes, slappey supports aliases by default. Here is a basic test command:
const BaseCommand = require('../../utils/structures/BaseCommand');
module.exports = class TestCommand extends BaseCommand {
constructor() {
super('test', 'testing', ['alias1', 'alias2', 'etc']);
}
async run(client, message, args) {
for (const cmd of client.commands.array()){
console.log(cmd);
}
}
}
This has command with name: test Also answers to the three aliases: alias1, alias2 and etc
Each element in the array (third parameter in the super) is an alias
Why not just use the aliases as they are in slappey today?
there are aliases already? how do you use them
Yes, slappey supports aliases by default. Here is a basic test command:
const BaseCommand = require('../../utils/structures/BaseCommand'); module.exports = class TestCommand extends BaseCommand { constructor() { super('test', 'testing', ['alias1', 'alias2', 'etc']); } async run(client, message, args) { for (const cmd of client.commands.array()){ console.log(cmd); } } }
This has command with name: test Also answers to the three aliases: alias1, alias2 and etc
Each element in the array (third parameter in the super) is an alias
okay thanks ill try that
basically what I'm thinking of is that when you generate a command you can choose the name and category as normal but after category, you can add aliases separated by spaces for example, it could look like this: