feat: extracted renderer from /stats

This commit is contained in:
TresAbhi committed 2023-06-23 01:35:15 +00:00
1 parent bcbc1e259f
commit 752f9b339b
21 files changed
+329 -273

No files matched your search

+2 -2
View File
@@ -2,11 +2,11 @@ import { SlashCommandBuilder } from 'discord.js';
import markdownEscape from 'markdown-escape';
import discord from '../../discord.json' assert { type: 'json' };
import usernameAutocomplete from '../core/autocomplete/username.js';
import getBlitzAccount from '../core/blitz/getBlitzAccount.js';
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
import negativeEmbed from '../core/interaction/negativeEmbed.js';
import positiveEmbed from '../core/interaction/positiveEmbed.js';
import addUsernameOption from '../core/options/addUsernameOption.js';
import resolvePlayer from '../core/options/resolvePlayer.js';
import { WARGAMING_APPLICATION_ID } from '../core/process/args.js';
import { CommandRegistry } from '../events/interactionCreate.js';
import { AccountInfo } from '../types/accountInfo.js';
@@ -23,7 +23,7 @@ export default {
.addStringOption((option) => addUsernameOption(option).setRequired(true)),
async execute(interaction) {
const blitzAccount = await getBlitzAccount(interaction);
const blitzAccount = await resolvePlayer(interaction);
const { id, server } = blitzAccount;
const accountInfo = await getWargamingResponse<AccountInfo>(
`https://api.wotblitz.${server}/wotb/account/info/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}`,