mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 03:07:04 +02:00
feat: custom periods for /stats and /tankstats
This commit is contained in:
1 parent
78424c1535
commit
e0c1db2a0b
14 files changed
+125
-49
No files matched your search
@@ -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,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);
|
||||
}
|
||||
Reference in new issue
Block a user