Skip to content

Commit

Permalink
make LNReader group commands
Browse files Browse the repository at this point in the history
  • Loading branch information
nyagami committed May 12, 2024
1 parent 61a68b7 commit 13ab01f
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/commands/General/dataHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import { ApplicationCommandOptionType, CommandInteraction, EmbedBuilder } from "
import { Discord } from "discordx";

@Discord()
@Category('General')
@Category('LNReader')
export default class DataHelperCommand {
@Slash({name: 'migrate'})
async migrate(
@SlashChoice(...['v1.1.19', 'v2.0.0-beta.1'])
@SlashOption({
name: 'version',
description: 'Your current version',
type: ApplicationCommandOptionType.String
type: ApplicationCommandOptionType.String,
localizationSource: 'COMMANDS.MIGRATE.DESCRIPTION'
})
version: string,
interaction: CommandInteraction
Expand Down
8 changes: 5 additions & 3 deletions src/commands/General/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Plugin } from "@/entities";
import { pluginRepoVersion } from "@/utils/constants/plugins";

@Discord()
@Category('General')
@Category('LNReader')
@Injectable()
export default class PluginsCommand {
constructor(
Expand All @@ -21,7 +21,8 @@ export default class PluginsCommand {
description: "Filter plugins with language",
name: 'language',
type: ApplicationCommandOptionType.String,
required: false
required: false,
localizationSource: 'COMMANDS.PLUGINS.DESCRIPTION'
})
language: string,
@SlashOption({
Expand Down Expand Up @@ -74,7 +75,8 @@ export default class PluginsCommand {
name: "repo",
type: ApplicationCommandOptionType.String,
required: true,
description: "Choose repo to make issue/request"
description: "Choose repo to make issue/request",
localizationSource: 'COMMANDS.ISSUE.DESCRIPTION'
})
repo: string,
interaction: CommandInteraction
Expand Down
9 changes: 9 additions & 0 deletions src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ const en = {
DESCRIPTION: 'Pong!',
MESSAGE: '{member:string} Pong! The message round-trip took {time:number}ms.{heartbeat:string}',
},
PLUGINS: {
DESCRIPTION: 'Plugins info',
},
ISSUE: {
DESCRIPTION: 'Report issue/request',
},
MIGRATE: {
DESCRIPTION: 'Migration helper',
},
},
} satisfies BaseTranslation

Expand Down
36 changes: 36 additions & 0 deletions src/i18n/i18n-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,24 @@ type RootTranslation = {
*/
MESSAGE: RequiredParams<'heartbeat' | 'member' | 'time'>
}
PLUGINS: {
/**
* P​l​u​g​i​n​s​ ​i​n​f​o
*/
DESCRIPTION: string
}
ISSUE: {
/**
* R​e​p​o​r​t​ ​i​s​s​u​e​/​r​e​q​u​e​s​t
*/
DESCRIPTION: string
}
MIGRATE: {
/**
* M​i​g​r​a​t​i​o​n​ ​h​e​l​p​e​r
*/
DESCRIPTION: string
}
}
}

Expand Down Expand Up @@ -322,6 +340,24 @@ export type TranslationFunctions = {
*/
MESSAGE: (arg: { heartbeat: string, member: string, time: number }) => LocalizedString
}
PLUGINS: {
/**
* Plugins info
*/
DESCRIPTION: () => LocalizedString
}
ISSUE: {
/**
* Report issue/request
*/
DESCRIPTION: () => LocalizedString
}
MIGRATE: {
/**
* Migration helper
*/
DESCRIPTION: () => LocalizedString
}
}
}

Expand Down

0 comments on commit 13ab01f

Please sign in to comment.