fix: a few type erros

This commit is contained in:
TrèsAbhi committed 2023-10-11 19:04:58 -05:00
1 parent 59bae96c1b
commit 0db96795b3
7 files changed
+8 -19

No files matched your search

-1
View File
@@ -15,7 +15,6 @@ import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton';
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand'; import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
import { CommandRegistryRaw } from '../events/interactionCreate'; import { CommandRegistryRaw } from '../events/interactionCreate';
import evolution from '../renderers/evolution'; import evolution from '../renderers/evolution';
import { StatType } from '../renderers/stats';
import { AccountInfo } from '../types/accountInfo'; import { AccountInfo } from '../types/accountInfo';
export const evolutionCommand = new Promise<CommandRegistryRaw>( export const evolutionCommand = new Promise<CommandRegistryRaw>(
+1 -6
View File
@@ -91,17 +91,12 @@ export const ownedTanksCommand: CommandRegistry = {
<Wrapper> <Wrapper>
<TitleBar <TitleBar
name={accountInfo[id].nickname} name={accountInfo[id].nickname}
nameDiscriminator={
clanData[id]?.clan ? `[${clanData[id]?.clan?.tag}]` : undefined
}
image={ image={
clanData[id]?.clan clanData[id]?.clan
? `https://wotblitz-gc.gcdn.co/icons/clanEmblems1x/clan-icon-v2-${clanData[id]?.clan?.emblem_set_id}.png` ? `https://wotblitz-gc.gcdn.co/icons/clanEmblems1x/clan-icon-v2-${clanData[id]?.clan?.emblem_set_id}.png`
: undefined : undefined
} }
description={`Tier ${ description={`Tier ${TIER_ROMAN_NUMERALS[tier as Tier]} tanks`}
TIER_ROMAN_NUMERALS[tier as Tier]
} tanks • ${new Date().toDateString()}`}
/> />
{filteredTanks.length === 0 && <NoData type={NoDataType.TanksFound} />} {filteredTanks.length === 0 && <NoData type={NoDataType.TanksFound} />}
+1 -2
View File
@@ -513,8 +513,7 @@ export const ratingsCommand = new Promise<CommandRegistryRaw>(
<TitleBar <TitleBar
name={titleName} name={titleName}
image={titleImage} image={titleImage}
nameDiscriminator={titleNameDiscriminator} description={titleDescription}
description={`${titleDescription} • ${new Date().toDateString()}`}
/> />
{items && ( {items && (
+1 -2
View File
@@ -1,5 +1,4 @@
import { Percentile } from '../../../constants/percentiles'; import { Percentile } from '../../../constants/percentiles';
import { TankType } from '../../../core/blitz/tankopedia';
import { theme } from '../../../stitches.config'; import { theme } from '../../../stitches.config';
import { TREE_TYPE_ICONS, TreeTypeEnum } from '../../Tanks'; import { TREE_TYPE_ICONS, TreeTypeEnum } from '../../Tanks';
import { RowStat } from './RowStat'; import { RowStat } from './RowStat';
@@ -17,7 +16,7 @@ interface RowProps {
title: string; title: string;
minimized?: boolean; minimized?: boolean;
treeType?: TreeTypeEnum; treeType?: TreeTypeEnum;
tankType?: TankType; tankType?: string;
stats: (RowStatItem | undefined)[]; stats: (RowStatItem | undefined)[];
} }
@@ -34,6 +34,8 @@ export default async function normalizeInteractionReturnable(
} else if (item instanceof AttachmentBuilder) { } else if (item instanceof AttachmentBuilder) {
if (!reply.files) reply.files = []; if (!reply.files) reply.files = [];
reply.files.push(item); reply.files.push(item);
} else if (item === null) {
return;
} else { } else {
const image = await jsxToPng(item); const image = await jsxToPng(item);
if (!reply.files) reply.files = []; if (!reply.files) reply.files = [];
+2 -4
View File
@@ -13,11 +13,10 @@ import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand';
import { AccountInfo } from '../types/accountInfo'; import { AccountInfo } from '../types/accountInfo';
import { Histories } from '../types/histories'; import { Histories } from '../types/histories';
import { PlayerClanInfo } from '../types/playerClanData'; import { PlayerClanInfo } from '../types/playerClanData';
import { StatType } from './stats';
export default async function evolution<Type extends StatType>( export default async function evolution<Type extends StatType>(
type: Type, type: Type,
{ start, end, evolutionName }: ResolvedPeriod, { start, end, name }: ResolvedPeriod,
{ region: server, id }: ResolvedPlayer, { region: server, id }: ResolvedPlayer,
tankId: Type extends 'tank' ? number : null, tankId: Type extends 'tank' ? number : null,
) { ) {
@@ -84,9 +83,8 @@ export default async function evolution<Type extends StatType>(
<Wrapper> <Wrapper>
<TitleBar <TitleBar
name={accountInfo[id].nickname} name={accountInfo[id].nickname}
nameDiscriminator={nameDiscriminator}
image={image} image={image}
description={`${evolutionName} • ${new Date().toDateString()}`} description={name}
/> />
{/* goofy ahh bug forces me to call them as functions */} {/* goofy ahh bug forces me to call them as functions */}
+1 -4
View File
@@ -192,15 +192,12 @@ export default async function today(
<Wrapper> <Wrapper>
<TitleBar <TitleBar
name={accountInfo[id].nickname} name={accountInfo[id].nickname}
nameDiscriminator={
clanData[id]?.clan ? `[${clanData[id]?.clan?.tag}]` : undefined
}
image={ image={
clanData[id]?.clan clanData[id]?.clan
? `https://wotblitz-gc.gcdn.co/icons/clanEmblems1x/clan-icon-v2-${clanData[id]?.clan?.emblem_set_id}.png` ? `https://wotblitz-gc.gcdn.co/icons/clanEmblems1x/clan-icon-v2-${clanData[id]?.clan?.emblem_set_id}.png`
: undefined : undefined
} }
description={`Today's breakdown • ${new Date().toDateString()}`} description="Today's breakdown"
/> />
{rows.length === 0 && <NoData type={NoDataType.BattlesInPeriod} />} {rows.length === 0 && <NoData type={NoDataType.BattlesInPeriod} />}