feat: used dahses for command readibility

This commit is contained in:
TresAbhi committed 2023-08-04 02:24:14 +00:00
1 parent 23dd088466
commit 91f364b76a
13 files changed
+37 -49

No files matched your search

+11 -10
View File
@@ -4,7 +4,8 @@ import {
} from 'discord.js';
import { PERIOD_NAMES } from '../discord/resolvePeriodFromCommand';
export type Period = 'period' | 'customperiod';
export type PeriodSubcommand = 'period' | 'custom';
export type PeriodOption = `${number}` | 'career';
export default function addPeriodSubCommands(
option: SlashCommandSubcommandGroupBuilder,
@@ -16,18 +17,18 @@ export default function addPeriodSubCommands(
.addSubcommand((option) =>
extra(
option
.setName('period' satisfies Period)
.setName('period' satisfies PeriodSubcommand)
.setDescription(PERIOD_NAMES.period)
.addStringOption((option) =>
option
.setName('days')
.setName('period')
.setDescription('A preset period')
.setChoices(
{ name: 'Today', value: '1' },
{ name: '30 days', value: '30' },
{ name: '60 days', value: '60' },
{ name: '90 days', value: '90' },
{ name: 'Career', value: 'Infinity' },
{ name: 'Today', value: '1' satisfies PeriodOption },
{ name: '30 days', value: '30' satisfies PeriodOption },
{ name: '60 days', value: '60' satisfies PeriodOption },
{ name: '90 days', value: '90' satisfies PeriodOption },
{ name: 'Career', value: 'career' satisfies PeriodOption },
)
.setRequired(true),
),
@@ -36,8 +37,8 @@ export default function addPeriodSubCommands(
.addSubcommand((option) =>
extra(
option
.setName('customperiod' satisfies Period)
.setDescription(PERIOD_NAMES.customperiod)
.setName('custom' satisfies PeriodSubcommand)
.setDescription(PERIOD_NAMES.custom)
.addIntegerOption((option) =>
option
.setName('start')