Add help command tests

This commit is contained in:
Ethan Lane 2022-01-02 14:56:08 +00:00
parent 6994a339b6
commit 451bfe1039
Signed by: Vylpes
GPG key ID: EED233CC06D12504
5 changed files with 83 additions and 16 deletions

View file

@ -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;
}
}