Add help command tests
This commit is contained in:
parent
6994a339b6
commit
451bfe1039
5 changed files with 83 additions and 16 deletions
|
@ -30,7 +30,7 @@ export default class Help extends Command {
|
|||
|
||||
public SendAll(context: ICommandContext): ICommandReturnContext {
|
||||
const allCommands = this.GetAllCommandData();
|
||||
const cateogries = this.DetermineCategories(allCommands);
|
||||
const cateogries = [...new Set(allCommands.map(x => x.Category!))];;
|
||||
|
||||
const embed = new PublicEmbed(context, "Commands", "");
|
||||
|
||||
|
@ -119,16 +119,4 @@ export default class Help extends Command {
|
|||
|
||||
return data;
|
||||
}
|
||||
|
||||
public DetermineCategories(commands: ICommandData[]): string[] {
|
||||
const result: string[] = [];
|
||||
|
||||
commands.forEach(cmd => {
|
||||
if (!result.includes(cmd.Category!)) {
|
||||
result.push(cmd.Category!);
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue