feat: custom periods for /stats and /tankstats

This commit is contained in:
TresAbhi committed 2023-06-18 01:56:21 +00:00
1 parent 78424c1535
commit e0c1db2a0b
14 files changed
+125 -49

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
import { SlashCommandSubcommandBuilder } from 'discord.js';
export default function addCustomPeriodOption(
option: SlashCommandSubcommandBuilder,
) {
return option
.addIntegerOption((option) =>
option
.setName('start')
.setDescription('Start of period in days ago from today')
.setMinValue(0)
.setRequired(true),
)
.addIntegerOption((option) =>
option
.setName('end')
.setDescription('End of period in days ago from today')
.setMinValue(0)
.setRequired(true),
);
}
@@ -8,7 +8,7 @@ export const statPeriodNames: Record<StatPeriod, string> = {
90: '90-day statistics',
career: 'Career statistics',
};
export default function addStatPeriodChoices(option: SlashCommandStringOption) {
export default function addPeriodChoices(option: SlashCommandStringOption) {
return option
.setName('period')
.setDescription('The period to get stats for')
+3 -1
View File
@@ -3,6 +3,8 @@ import { SlashCommandStringOption } from 'discord.js';
export default function addUsernameOption(option: SlashCommandStringOption) {
return option
.setName('username')
.setDescription('The username you use in Blitz')
.setDescription(
'The username you use in Blitz (inferred from Discord nickname by default)',
)
.setAutocomplete(true);
}