mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: updated /evolution
This commit is contained in:
1 parent
8c3675546f
commit
bcd3a00f91
6 files changed
+107
-99
No files matched your search
+78
-83
@@ -1,10 +1,21 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import {
|
||||||
|
SlashCommandBuilder,
|
||||||
|
SlashCommandSubcommandGroupBuilder,
|
||||||
|
} from 'discord.js';
|
||||||
|
import * as Graph from '../components/Graph';
|
||||||
|
import NoData, { NoDataType } from '../components/NoData';
|
||||||
|
import TitleBar from '../components/TitleBar';
|
||||||
|
import Wrapper from '../components/Wrapper';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../constants/wargamingApplicationID';
|
import { WARGAMING_APPLICATION_ID } from '../constants/wargamingApplicationID';
|
||||||
|
import { getAccountInfo } from '../core/blitz/getAccountInfo';
|
||||||
|
import { getClanLogo } from '../core/blitz/getClanLogo';
|
||||||
|
import { getPlayerClanInfo } from '../core/blitz/getPlayerClanInfo';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import resolveTankId from '../core/blitz/resolveTankId';
|
import resolveTankId from '../core/blitz/resolveTankId';
|
||||||
import getPlayerHistories from '../core/blitzstars/getPlayerHistories';
|
import getPlayerHistories from '../core/blitzstars/getPlayerHistories';
|
||||||
import getTankHistories from '../core/blitzstars/getTankHistories';
|
import getTankHistories from '../core/blitzstars/getTankHistories';
|
||||||
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups';
|
import addPeriodSubCommands from '../core/discord/addPeriodSubCommands';
|
||||||
|
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||||
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
||||||
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||||
import interactionToURL from '../core/discord/interactionToURL';
|
import interactionToURL from '../core/discord/interactionToURL';
|
||||||
@@ -20,52 +31,31 @@ import resolvePlayerFromCommand, {
|
|||||||
} from '../core/discord/resolvePlayerFromCommand';
|
} from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { CommandRegistryRaw } from '../events/interactionCreate';
|
import { CommandRegistryRaw } from '../events/interactionCreate';
|
||||||
import { AccountInfo } from '../types/accountInfo';
|
import { AccountInfo } from '../types/accountInfo';
|
||||||
import { PlayerClanInfo } from '../types/playerClanData';
|
|
||||||
|
type EvolutionStatType = 'player' | 'tank';
|
||||||
|
|
||||||
async function render(
|
async function render(
|
||||||
{ region, id }: ResolvedPlayer,
|
{ region, id }: ResolvedPlayer,
|
||||||
{ start, end, name }: ResolvedPeriod,
|
{ start, end, name }: ResolvedPeriod,
|
||||||
type: 'player' | 'tank',
|
type: 'player' | 'tank',
|
||||||
tankId?: number,
|
tankId: number | null,
|
||||||
) {
|
) {
|
||||||
let nameDiscriminator: string | undefined;
|
const clan = (await getPlayerClanInfo(region, id))[id]?.clan;
|
||||||
let image: string | undefined;
|
const logo = clan ? getClanLogo(clan.emblem_set_id) : undefined;
|
||||||
|
const histories = await (type === 'player'
|
||||||
if (type === 'player') {
|
? getPlayerHistories(region, id, {
|
||||||
const clan = (
|
start,
|
||||||
await getWargamingResponse<PlayerClanInfo>(
|
end,
|
||||||
`https://api.wotblitz.${region}/wotb/clans/accountinfo/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}&extra=clan`,
|
includeLatestHistories: true,
|
||||||
)
|
includePreviousHistories: true,
|
||||||
)[id]?.clan;
|
})
|
||||||
|
: getTankHistories(region, id, {
|
||||||
if (clan) nameDiscriminator = `[${clan.tag}]`;
|
tankId: tankId!,
|
||||||
image = clan
|
start,
|
||||||
? `https://wotblitz-gc.gcdn.co/icons/clanEmblems1x/clan-icon-v2-${clan.emblem_set_id}.png`
|
end,
|
||||||
: undefined;
|
includeLatestHistories: true,
|
||||||
} else {
|
includePreviousHistories: true,
|
||||||
nameDiscriminator = `(${await resolveTankName(tankId!)})`;
|
}));
|
||||||
image = (await tankopedia)[tankId!]?.images.normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
let histories: Histories;
|
|
||||||
|
|
||||||
if (type === 'player') {
|
|
||||||
histories = await getPlayerHistories(region, id, {
|
|
||||||
start,
|
|
||||||
end,
|
|
||||||
includeLatestHistories: true,
|
|
||||||
includePreviousHistories: true,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
histories = await getTankHistories(region, id, {
|
|
||||||
tankId: tankId!,
|
|
||||||
start,
|
|
||||||
end,
|
|
||||||
includeLatestHistories: true,
|
|
||||||
includePreviousHistories: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const plot = histories.map(
|
const plot = histories.map(
|
||||||
(history) =>
|
(history) =>
|
||||||
[
|
[
|
||||||
@@ -91,7 +81,7 @@ async function render(
|
|||||||
<Wrapper>
|
<Wrapper>
|
||||||
<TitleBar
|
<TitleBar
|
||||||
name={accountInfo[id].nickname}
|
name={accountInfo[id].nickname}
|
||||||
image={image}
|
image={logo}
|
||||||
description={name}
|
description={name}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -129,26 +119,32 @@ async function render(
|
|||||||
|
|
||||||
export const evolutionCommand = new Promise<CommandRegistryRaw>(
|
export const evolutionCommand = new Promise<CommandRegistryRaw>(
|
||||||
async (resolve) => {
|
async (resolve) => {
|
||||||
const command = await addStatTypeSubCommandGroups(
|
let playerGroup: SlashCommandSubcommandGroupBuilder;
|
||||||
new SlashCommandBuilder()
|
let tankGroup: SlashCommandSubcommandGroupBuilder;
|
||||||
.setName('evolution')
|
const command = new SlashCommandBuilder()
|
||||||
.setDescription('Evolution of statistics'),
|
.setName('evolution')
|
||||||
// (option) =>
|
.setDescription('Evolution of statistics')
|
||||||
// option
|
.addSubcommandGroup((option) => {
|
||||||
// .addStringOption((option) =>
|
playerGroup = option
|
||||||
// addStatPropertyOptions(option)
|
.setName('player')
|
||||||
// .setName('x')
|
.setDescription('Player statistics');
|
||||||
// .setDescription('X axis')
|
|
||||||
// .setRequired(false),
|
return playerGroup;
|
||||||
// )
|
})
|
||||||
// .addStringOption((option) =>
|
.addSubcommandGroup((option) => {
|
||||||
// addStatPropertyOptions(option)
|
tankGroup = option.setName('tank').setDescription('Tank statistics');
|
||||||
// .setName('y')
|
|
||||||
// .setDescription('Y axis')
|
return tankGroup;
|
||||||
// .setRequired(false),
|
});
|
||||||
// )
|
|
||||||
// .addStringOption(addUsernameChoices),
|
await Promise.all([
|
||||||
);
|
addPeriodSubCommands(playerGroup!, (option) =>
|
||||||
|
option.addStringOption(addUsernameChoices),
|
||||||
|
),
|
||||||
|
addPeriodSubCommands(tankGroup!, (option) =>
|
||||||
|
option.addStringOption(addUsernameChoices),
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
@@ -157,35 +153,35 @@ export const evolutionCommand = new Promise<CommandRegistryRaw>(
|
|||||||
command,
|
command,
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const commandGroup = interaction.options.getSubcommandGroup(
|
const commandGroup =
|
||||||
true,
|
interaction.options.getSubcommandGroup() as EvolutionStatType;
|
||||||
) as StatType;
|
const resolvedPlayer = await resolvePlayerFromCommand(interaction);
|
||||||
const player = await resolvePlayerFromCommand(interaction);
|
const resolvedPeriod = resolvePeriodFromCommand(
|
||||||
const period = resolvePeriodFromCommand(player.region, interaction);
|
resolvedPlayer.region,
|
||||||
|
interaction,
|
||||||
|
);
|
||||||
const tankIdRaw = interaction.options.getString('tank')!;
|
const tankIdRaw = interaction.options.getString('tank')!;
|
||||||
const tankId =
|
const tankId =
|
||||||
commandGroup === 'tank' ? await resolveTankId(tankIdRaw) : null;
|
commandGroup === 'tank' ? await resolveTankId(tankIdRaw) : null;
|
||||||
const start = interaction.options.getInteger('start');
|
const start = interaction.options.getInteger('start');
|
||||||
const end = interaction.options.getInteger('end');
|
const end = interaction.options.getInteger('end');
|
||||||
const { nickname } = (
|
const { nickname } = (
|
||||||
await getWargamingResponse<AccountInfo>(
|
await getAccountInfo(resolvedPlayer.region, resolvedPlayer.id)
|
||||||
`https://api.wotblitz.${player.region}/wotb/account/info/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${player.id}`,
|
)[resolvedPlayer.id];
|
||||||
)
|
|
||||||
)[player.id];
|
|
||||||
const path = interactionToURL(interaction, {
|
const path = interactionToURL(interaction, {
|
||||||
...player,
|
...resolvedPlayer,
|
||||||
tankId,
|
tankId,
|
||||||
start,
|
start,
|
||||||
end,
|
end,
|
||||||
});
|
});
|
||||||
|
|
||||||
return [
|
return [
|
||||||
await render(commandGroup, period, player, tankId),
|
await render(resolvedPlayer, resolvedPeriod, commandGroup, tankId),
|
||||||
primaryButton(path, 'Refresh'),
|
primaryButton(path, 'Refresh'),
|
||||||
linkButton(
|
linkButton(
|
||||||
`https://www.blitzstars.com/player/${player.region}/${nickname}${
|
`https://www.blitzstars.com/player/${
|
||||||
commandGroup === 'tank' ? `/tank/${tankId!}` : ''
|
resolvedPlayer.region
|
||||||
}`,
|
}/${nickname}${commandGroup === 'tank' ? `/tank/${tankId!}` : ''}`,
|
||||||
'BlitzStars',
|
'BlitzStars',
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
@@ -194,21 +190,20 @@ export const evolutionCommand = new Promise<CommandRegistryRaw>(
|
|||||||
autocomplete: (interaction) => {
|
autocomplete: (interaction) => {
|
||||||
autocompleteUsername(interaction);
|
autocompleteUsername(interaction);
|
||||||
autocompleteTanks(interaction);
|
autocompleteTanks(interaction);
|
||||||
// autocompleteStatProperty(interaction, 'x');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async button(interaction) {
|
async button(interaction) {
|
||||||
const url = new URL(`https://example.com/${interaction.customId}`);
|
const url = new URL(`https://example.com/${interaction.customId}`);
|
||||||
const path = url.pathname.split('/').filter(Boolean);
|
const path = url.pathname.split('/');
|
||||||
const commandGroup = path[1] as StatType;
|
const commandGroup = path[1] as EvolutionStatType;
|
||||||
const player = await resolvePlayerFromButton(interaction);
|
const player = await resolvePlayerFromButton(interaction);
|
||||||
const period = resolvePeriodFromButton(player.region, interaction);
|
const period = resolvePeriodFromButton(player.region, interaction);
|
||||||
|
|
||||||
return await render(
|
return await render(
|
||||||
commandGroup,
|
|
||||||
period,
|
|
||||||
player,
|
player,
|
||||||
parseInt(url.searchParams.get('tankId')!),
|
period,
|
||||||
|
commandGroup,
|
||||||
|
parseInt(url.searchParams.get('tankId') ?? '0') || null,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import Wrapper from '../components/Wrapper';
|
|||||||
import { StatFilters, filterStats } from '../core/blitz/filterStats';
|
import { StatFilters, filterStats } from '../core/blitz/filterStats';
|
||||||
import { getAccountInfo } from '../core/blitz/getAccountInfo';
|
import { getAccountInfo } from '../core/blitz/getAccountInfo';
|
||||||
import { getClanLogo } from '../core/blitz/getClanLogo';
|
import { getClanLogo } from '../core/blitz/getClanLogo';
|
||||||
import { playerClanInfo } from '../core/blitz/playerClanInfo';
|
import { getPlayerClanInfo } from '../core/blitz/getPlayerClanInfo';
|
||||||
import { filtersToDescription } from '../core/blitzkrieg/filtersToDescription';
|
import { filtersToDescription } from '../core/blitzkrieg/filtersToDescription';
|
||||||
import { getTierWeights } from '../core/blitzkrieg/getTierWeights';
|
import { getTierWeights } from '../core/blitzkrieg/getTierWeights';
|
||||||
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
||||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats';
|
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats';
|
||||||
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups';
|
import addStatTypeSubCommands from '../core/discord/addStatTypeSubCommands';
|
||||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||||
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
||||||
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||||
@@ -37,7 +37,7 @@ async function render(
|
|||||||
filters: StatFilters,
|
filters: StatFilters,
|
||||||
) {
|
) {
|
||||||
const nickname = (await getAccountInfo(region, id))[id].nickname;
|
const nickname = (await getAccountInfo(region, id))[id].nickname;
|
||||||
const clan = (await playerClanInfo(region, id))[id]?.clan;
|
const clan = (await getPlayerClanInfo(region, id))[id]?.clan;
|
||||||
const clanImage = clan ? getClanLogo(clan.emblem_set_id) : undefined;
|
const clanImage = clan ? getClanLogo(clan.emblem_set_id) : undefined;
|
||||||
const diffedTankStats = await getDiffedTankStats(region, id, start, end);
|
const diffedTankStats = await getDiffedTankStats(region, id, start, end);
|
||||||
const { stats, supplementary, filteredOrder } = await filterStats(
|
const { stats, supplementary, filteredOrder } = await filterStats(
|
||||||
@@ -66,7 +66,7 @@ async function render(
|
|||||||
|
|
||||||
export const fullStatsCommand = new Promise<CommandRegistryRaw>(
|
export const fullStatsCommand = new Promise<CommandRegistryRaw>(
|
||||||
async (resolve) => {
|
async (resolve) => {
|
||||||
const command = await addStatTypeSubCommandGroups(
|
const command = await addStatTypeSubCommands(
|
||||||
new SlashCommandBuilder()
|
new SlashCommandBuilder()
|
||||||
.setName('full-stats')
|
.setName('full-stats')
|
||||||
.setDescription('Full in-game statistics'),
|
.setDescription('Full in-game statistics'),
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import Wrapper from '../components/Wrapper';
|
|||||||
import { StatFilters, filterStats } from '../core/blitz/filterStats';
|
import { StatFilters, filterStats } from '../core/blitz/filterStats';
|
||||||
import { getAccountInfo } from '../core/blitz/getAccountInfo';
|
import { getAccountInfo } from '../core/blitz/getAccountInfo';
|
||||||
import { getClanLogo } from '../core/blitz/getClanLogo';
|
import { getClanLogo } from '../core/blitz/getClanLogo';
|
||||||
import { playerClanInfo } from '../core/blitz/playerClanInfo';
|
import { getPlayerClanInfo } from '../core/blitz/getPlayerClanInfo';
|
||||||
import { filtersToDescription } from '../core/blitzkrieg/filtersToDescription';
|
import { filtersToDescription } from '../core/blitzkrieg/filtersToDescription';
|
||||||
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
||||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats';
|
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats';
|
||||||
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups';
|
import addStatTypeSubCommands from '../core/discord/addStatTypeSubCommands';
|
||||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||||
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
||||||
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||||
@@ -35,7 +35,7 @@ async function render(
|
|||||||
filters: StatFilters,
|
filters: StatFilters,
|
||||||
) {
|
) {
|
||||||
const nickname = (await getAccountInfo(region, id))[id].nickname;
|
const nickname = (await getAccountInfo(region, id))[id].nickname;
|
||||||
const clan = (await playerClanInfo(region, id))[id]?.clan;
|
const clan = (await getPlayerClanInfo(region, id))[id]?.clan;
|
||||||
const clanImage = clan ? getClanLogo(clan.emblem_set_id) : undefined;
|
const clanImage = clan ? getClanLogo(clan.emblem_set_id) : undefined;
|
||||||
const diffedTankStats = await getDiffedTankStats(region, id, start, end);
|
const diffedTankStats = await getDiffedTankStats(region, id, start, end);
|
||||||
const { stats, supplementary } = await filterStats(diffedTankStats, filters);
|
const { stats, supplementary } = await filterStats(diffedTankStats, filters);
|
||||||
@@ -58,7 +58,7 @@ async function render(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const statsCommand = new Promise<CommandRegistryRaw>(async (resolve) => {
|
export const statsCommand = new Promise<CommandRegistryRaw>(async (resolve) => {
|
||||||
const command = await addStatTypeSubCommandGroups(
|
const command = await addStatTypeSubCommands(
|
||||||
new SlashCommandBuilder()
|
new SlashCommandBuilder()
|
||||||
.setName('stats')
|
.setName('stats')
|
||||||
.setDescription('Regular battles statistics'),
|
.setDescription('Regular battles statistics'),
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID
|
|||||||
import { PlayerClanInfo } from '../../types/playerClanData';
|
import { PlayerClanInfo } from '../../types/playerClanData';
|
||||||
import getWargamingResponse from './getWargamingResponse';
|
import getWargamingResponse from './getWargamingResponse';
|
||||||
|
|
||||||
export function playerClanInfo(region: Region, id: number) {
|
export function getPlayerClanInfo(region: Region, id: number) {
|
||||||
return getWargamingResponse<PlayerClanInfo>(
|
return getWargamingResponse<PlayerClanInfo>(
|
||||||
`https://api.wotblitz.${region}/wotb/clans/accountinfo/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}&extra=clan`,
|
`https://api.wotblitz.${region}/wotb/clans/accountinfo/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}&extra=clan`,
|
||||||
);
|
);
|
||||||
@@ -1,10 +1,14 @@
|
|||||||
import { SlashCommandBuilder, SlashCommandSubcommandBuilder } from 'discord.js';
|
import {
|
||||||
|
SlashCommandBuilder,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
|
SlashCommandSubcommandGroupBuilder,
|
||||||
|
} from 'discord.js';
|
||||||
|
|
||||||
export type PeriodType = 'today' | '30' | '60' | '90' | 'custom';
|
export type PeriodType = 'today' | '30' | '60' | '90' | 'career' | 'custom';
|
||||||
export type PeriodSize = 'today' | `${number}` | 'career';
|
export type PeriodSize = 'today' | `${number}` | 'career';
|
||||||
|
|
||||||
export default function addPeriodSubCommands(
|
export default function addPeriodSubCommands(
|
||||||
option: SlashCommandBuilder,
|
option: SlashCommandBuilder | SlashCommandSubcommandGroupBuilder,
|
||||||
extra: (
|
extra: (
|
||||||
option: SlashCommandSubcommandBuilder,
|
option: SlashCommandSubcommandBuilder,
|
||||||
) => SlashCommandSubcommandBuilder = (option) => option,
|
) => SlashCommandSubcommandBuilder = (option) => option,
|
||||||
@@ -22,6 +26,9 @@ export default function addPeriodSubCommands(
|
|||||||
.addSubcommand((option) =>
|
.addSubcommand((option) =>
|
||||||
extra(option.setName('90').setDescription('90 days')),
|
extra(option.setName('90').setDescription('90 days')),
|
||||||
)
|
)
|
||||||
|
.addSubcommand((option) =>
|
||||||
|
extra(option.setName('career').setDescription('Career')),
|
||||||
|
)
|
||||||
.addSubcommand((option) =>
|
.addSubcommand((option) =>
|
||||||
extra(
|
extra(
|
||||||
option
|
option
|
||||||
|
|||||||
+10
-4
@@ -1,16 +1,22 @@
|
|||||||
import { SlashCommandBuilder, SlashCommandSubcommandBuilder } from 'discord.js';
|
import {
|
||||||
|
SlashCommandBuilder,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
|
SlashCommandSubcommandGroupBuilder,
|
||||||
|
} from 'discord.js';
|
||||||
import { TREE_TYPE_NAMES, TreeTypeString } from '../../components/Tanks';
|
import { TREE_TYPE_NAMES, TreeTypeString } from '../../components/Tanks';
|
||||||
import { tankopediaInfo } from '../blitz/tankopedia';
|
import { tankopediaInfo } from '../blitz/tankopedia';
|
||||||
import addPeriodSubCommands from './addPeriodSubCommands';
|
import addPeriodSubCommands from './addPeriodSubCommands';
|
||||||
import addTankChoices from './addTankChoices';
|
import addTankChoices from './addTankChoices';
|
||||||
import addTierChoices from './addTierChoices';
|
import addTierChoices from './addTierChoices';
|
||||||
|
|
||||||
export default async function addStatTypeSubCommandGroups(
|
export default async function addStatTypeSubCommands<
|
||||||
option: SlashCommandBuilder,
|
OptionType extends SlashCommandBuilder | SlashCommandSubcommandGroupBuilder,
|
||||||
|
>(
|
||||||
|
option: OptionType,
|
||||||
extra: (
|
extra: (
|
||||||
option: SlashCommandSubcommandBuilder,
|
option: SlashCommandSubcommandBuilder,
|
||||||
) => SlashCommandSubcommandBuilder = (option) => option,
|
) => SlashCommandSubcommandBuilder = (option) => option,
|
||||||
) {
|
): Promise<OptionType> {
|
||||||
const awaitedTankopediaInfo = await tankopediaInfo;
|
const awaitedTankopediaInfo = await tankopediaInfo;
|
||||||
|
|
||||||
addPeriodSubCommands(option, (option) => {
|
addPeriodSubCommands(option, (option) => {
|
||||||
Reference in new issue
Block a user