Transcribe command descriptions and call localize

This commit is contained in:
tacheometry committed 2023-12-15 14:42:36 +02:00
1 parent 46d1cfb008
commit 2cfab3209b
28 files changed
+578 -181

No files matched your search

+2 -3
View File
@@ -4,12 +4,11 @@ import { BaseSlashCommandInteraction } from '../../../classes/interactions';
import { ExtendedClient } from '../../../types/clientTypes';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes';
import { checkValidGuildId } from '../../../utils/validation/systemCommandValidator';
import { localizeCommand } from '../../../common/localeUtil';
class GuildsCommand extends BaseSlashCommandInteraction {
constructor() {
const data = new SlashCommandBuilder()
.setName('guilds')
.setDescription('Show the top 25 guilds by member count.');
const data = localizeCommand(new SlashCommandBuilder().setName('guilds'));
const isSystemCommand: boolean = true;
super(data, isSystemCommand);
}
+2 -3
View File
@@ -10,12 +10,11 @@ import { BaseSlashCommandInteraction } from '../../../classes/interactions';
import { ExtendedClient } from '../../../types/clientTypes';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes';
import { checkValidGuildId } from '../../../utils/validation/systemCommandValidator';
import { localizeCommand } from '../../../common/localeUtil';
class ReloadCommand extends BaseSlashCommandInteraction {
constructor() {
const data = new SlashCommandBuilder()
.setName('reload')
.setDescription('Reload slash command, autocomplete and component interactions across shards.');
const data = localizeCommand(new SlashCommandBuilder().setName('reload'));
const isSystemCommand: boolean = true;
super(data, isSystemCommand);
}
+21 -21
View File
@@ -10,30 +10,30 @@ import { ExtendedClient } from '../../../types/clientTypes';
import { BaseSlashCommandParams, BaseSlashCommandReturnType, ShardInfo } from '../../../types/interactionTypes';
import { checkValidGuildId } from '../../../utils/validation/systemCommandValidator';
import { Logger } from 'pino';
import { localizeCommand } from '../../../common/localeUtil';
class ShardsCommand extends BaseSlashCommandInteraction {
constructor() {
const data = new SlashCommandBuilder()
.setName('shards')
.setDescription('Show information about all connected shards.')
.addStringOption((option) =>
option
.setName('sort')
.setDescription('What to sort the shards by.')
.setRequired(false)
.addChoices(
{ name: 'None (Shard ID)', value: 'none' },
{ name: 'Memory usage', value: 'memory' },
{ name: 'Voice Connections', value: 'connections' },
{ name: 'Tracks', value: 'tracks' },
{ name: 'Listeners', value: 'listeners' },
{ name: 'Guilds', value: 'guilds' },
{ name: 'Members', value: 'members' }
)
)
.addIntegerOption((option) =>
option.setName('page').setDescription('Page number to display for the shards').setMinValue(1)
);
// TODO: Localize choices
const data = localizeCommand(
new SlashCommandBuilder()
.setName('shards')
.addStringOption((option) =>
option
.setName('sort')
.setRequired(false)
.addChoices(
{ name: 'None (Shard ID)', value: 'none' },
{ name: 'Memory usage', value: 'memory' },
{ name: 'Voice Connections', value: 'connections' },
{ name: 'Tracks', value: 'tracks' },
{ name: 'Listeners', value: 'listeners' },
{ name: 'Guilds', value: 'guilds' },
{ name: 'Members', value: 'members' }
)
)
.addIntegerOption((option) => option.setName('page').setMinValue(1))
);
const isSystemCommand: boolean = true;
super(data, isSystemCommand);
}
@@ -5,12 +5,11 @@ import { BaseSlashCommandInteraction } from '../../../classes/interactions';
import { getBotStatistics, getDiscordStatus, getPlayerStatistics, getSystemStatus } from '../../../common/statusUtils';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes';
import { checkValidGuildId } from '../../../utils/validation/systemCommandValidator';
import { localizeCommand } from '../../../common/localeUtil';
class SystemStatusCommand extends BaseSlashCommandInteraction {
constructor() {
const data = new SlashCommandBuilder()
.setName('systemstatus')
.setDescription('Show operational status of the bot with additional technical information.');
const data = localizeCommand(new SlashCommandBuilder().setName('systemstatus'));
const isSystemCommand: boolean = true;
super(data, isSystemCommand);
}