Skip to content

Commit

Permalink
move language in help #2711
Browse files Browse the repository at this point in the history
  • Loading branch information
BastLast committed Dec 18, 2024
1 parent 7252819 commit e2b51f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
14 changes: 2 additions & 12 deletions Discord/src/commands/player/HelpCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,10 @@ function getListOfMentionFromCommandData(commandData: [string, {
* @param language used for the error message in case the command doesn't exist
*/
function getCommandByCategories(language: Language): { [key: string]: string[] } {
const serverCommands: string[] = [], utilCommands: string[] = [], playerCommands: string[] = [],
const utilCommands: string[] = [], playerCommands: string[] = [],
missionCommands: string[] = [], guildCommands: string[] = [], petCommands: string[] = [];
for (const commandData of Object.entries(HelpConstants.COMMANDS_DATA)) {
switch (commandData[1].CATEGORY) {
case HelpConstants.COMMAND_CATEGORY.SERVER:
serverCommands.push(
getListOfMentionFromCommandData(commandData, language)
);
break;
case HelpConstants.COMMAND_CATEGORY.UTIL:
utilCommands.push(
getListOfMentionFromCommandData(commandData, language)
Expand Down Expand Up @@ -67,7 +62,7 @@ function getCommandByCategories(language: Language): { [key: string]: string[] }
break;
}
}
return {serverCommands, utilCommands, playerCommands, missionCommands, guildCommands, petCommands};
return {utilCommands, playerCommands, missionCommands, guildCommands, petCommands};
}

/**
Expand All @@ -77,7 +72,6 @@ function getCommandByCategories(language: Language): { [key: string]: string[] }
*/
function generateGenericHelpMessage(helpMessage: DraftBotEmbed, interaction: DraftbotInteraction): void {
const {
serverCommands,
utilCommands,
playerCommands,
missionCommands,
Expand All @@ -96,10 +90,6 @@ function generateGenericHelpMessage(helpMessage: DraftBotEmbed, interaction: Dra
})}\n\u200b`
);
helpMessage.addFields([
{
name: i18n.t("commands:help.serverCommands", {lng: interaction.userLanguage}),
value: `${serverCommands.sort().join(HelpConstants.COMMAND_SEPARATOR_FOR_GENERAL_DESCRIPTION)}`
},
{
name: i18n.t("commands:help.utilCommands", {lng: interaction.userLanguage}),
value: `${utilCommands.sort().join(HelpConstants.COMMAND_SEPARATOR_FOR_GENERAL_DESCRIPTION)}`
Expand Down
3 changes: 1 addition & 2 deletions Lib/src/constants/HelpConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export abstract class HelpConstants {
static readonly COMMAND_SEPARATOR_FOR_GENERAL_DESCRIPTION = " • ";

static readonly COMMAND_CATEGORY = {
SERVER: "server",
UTIL: "util",
PLAYER: "player",
MISSION: "mission",
Expand Down Expand Up @@ -125,7 +124,7 @@ export abstract class HelpConstants {
{
EMOTE: ":flag_gb:",
NAME: "language",
CATEGORY: "server"
CATEGORY: "util"
},
TOP:
{
Expand Down

0 comments on commit e2b51f1

Please sign in to comment.