mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
feat: switched to Node module resolution
This commit is contained in:
1 parent
21158e9081
commit
1d4ac2f133
107 files changed
+514
-506
No files matched your search
+10
-10
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
|
|||||||
Examples of behavior that contributes to a positive environment for our
|
Examples of behavior that contributes to a positive environment for our
|
||||||
community include:
|
community include:
|
||||||
|
|
||||||
* Demonstrating empathy and kindness toward other people
|
- Demonstrating empathy and kindness toward other people
|
||||||
* Being respectful of differing opinions, viewpoints, and experiences
|
- Being respectful of differing opinions, viewpoints, and experiences
|
||||||
* Giving and gracefully accepting constructive feedback
|
- Giving and gracefully accepting constructive feedback
|
||||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
- Accepting responsibility and apologizing to those affected by our mistakes,
|
||||||
and learning from the experience
|
and learning from the experience
|
||||||
* Focusing on what is best not just for us as individuals, but for the
|
- Focusing on what is best not just for us as individuals, but for the
|
||||||
overall community
|
overall community
|
||||||
|
|
||||||
Examples of unacceptable behavior include:
|
Examples of unacceptable behavior include:
|
||||||
|
|
||||||
* The use of sexualized language or imagery, and sexual attention or
|
- The use of sexualized language or imagery, and sexual attention or
|
||||||
advances of any kind
|
advances of any kind
|
||||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||||
* Public or private harassment
|
- Public or private harassment
|
||||||
* Publishing others' private information, such as a physical or email
|
- Publishing others' private information, such as a physical or email
|
||||||
address, without their explicit permission
|
address, without their explicit permission
|
||||||
* Other conduct which could reasonably be considered inappropriate in a
|
- Other conduct which could reasonably be considered inappropriate in a
|
||||||
professional setting
|
professional setting
|
||||||
|
|
||||||
## Enforcement Responsibilities
|
## Enforcement Responsibilities
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// https://vitepress.dev/guide/custom-theme
|
// https://vitepress.dev/guide/custom-theme
|
||||||
import { h } from 'vue'
|
import { h } from 'vue';
|
||||||
import Theme from 'vitepress/theme'
|
import Theme from 'vitepress/theme';
|
||||||
import './style.css'
|
import './style.css';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
extends: Theme,
|
extends: Theme,
|
||||||
Layout: () => {
|
Layout: () => {
|
||||||
return h(Theme.Layout, null, {
|
return h(Theme.Layout, null, {
|
||||||
// https://vitepress.dev/guide/extending-default-theme#layout-slots
|
// https://vitepress.dev/guide/extending-default-theme#layout-slots
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
enhanceApp({ app, router, siteData }) {
|
enhanceApp({ app, router, siteData }) {
|
||||||
// ...
|
// ...
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
@@ -88,4 +88,3 @@
|
|||||||
.DocSearch {
|
.DocSearch {
|
||||||
--docsearch-primary-color: var(--vp-c-brand) !important;
|
--docsearch-primary-color: var(--vp-c-brand) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
+3
-1
@@ -16,7 +16,8 @@
|
|||||||
"start:server": "node --enable-source-maps --trace-warnings dist/server.cjs",
|
"start:server": "node --enable-source-maps --trace-warnings dist/server.cjs",
|
||||||
"host:docs": "vitepress preview docs",
|
"host:docs": "vitepress preview docs",
|
||||||
"zip": "zip -r dist.zip dist",
|
"zip": "zip -r dist.zip dist",
|
||||||
"lint": "npx tsc"
|
"lint": "npx tsc",
|
||||||
|
"format": "prettier --write \"**/*.@(json|js|jsx|css|md|ts|tsx|html|xml|yml|gltf)\""
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -42,6 +43,7 @@
|
|||||||
"@types/markdown-escape": "^1.1.0",
|
"@types/markdown-escape": "^1.1.0",
|
||||||
"@types/node": "^20.2.1",
|
"@types/node": "^20.2.1",
|
||||||
"@types/react": "^18.2.7",
|
"@types/react": "^18.2.7",
|
||||||
|
"prettier": "^3.0.0",
|
||||||
"typescript": "^5.0.4",
|
"typescript": "^5.0.4",
|
||||||
"vitepress": "^1.0.0-beta.3"
|
"vitepress": "^1.0.0-beta.3"
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -1,9 +1,9 @@
|
|||||||
import { Client, GatewayIntentBits } from 'discord.js';
|
import { Client, GatewayIntentBits } from 'discord.js';
|
||||||
import { DISCORD_TOKEN } from './core/node/arguments.js';
|
import { DISCORD_TOKEN } from './core/node/arguments';
|
||||||
import { registerErrorHandlers } from './events/error.js';
|
import { registerErrorHandlers } from './events/error';
|
||||||
import guildMemberAdd from './events/guildMemberAdd.js';
|
import guildMemberAdd from './events/guildMemberAdd';
|
||||||
import interactionCreate from './events/interactionCreate/index.js';
|
import interactionCreate from './events/interactionCreate';
|
||||||
import ready from './events/ready.js';
|
import ready from './events/ready';
|
||||||
|
|
||||||
export const client = new Client({
|
export const client = new Client({
|
||||||
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers],
|
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers],
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import packageJSON from '../../package.json' assert { type: 'json' };
|
import packageJSON from '../../package.json' assert { type: 'json' };
|
||||||
import { client } from '../bot.js';
|
import { client } from '../bot';
|
||||||
import { tankopedia } from '../core/blitz/tankopedia.js';
|
import { tankopedia } from '../core/blitz/tankopedia';
|
||||||
import { tankAverages } from '../core/blitzstars/tankAverages.js';
|
import { tankAverages } from '../core/blitzstars/tankAverages';
|
||||||
import embedInfo from '../core/discord/embedInfo.js';
|
import embedInfo from '../core/discord/embedInfo';
|
||||||
import markdownTable from '../core/discord/markdownTable.js';
|
import markdownTable from '../core/discord/markdownTable';
|
||||||
import getClientId from '../core/node/getClientId.js';
|
import getClientId from '../core/node/getClientId';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
|
|
||||||
const executionStart = new Date().getTime();
|
const executionStart = new Date().getTime();
|
||||||
|
|
||||||
|
|||||||
+17
-17
@@ -1,21 +1,21 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import calculateWN8 from '../core/blitz/calculateWN8.js';
|
import calculateWN8 from '../core/blitz/calculateWN8';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import sumStats from '../core/blitz/sumStats.js';
|
import sumStats from '../core/blitz/sumStats';
|
||||||
import { tankopedia } from '../core/blitz/tankopedia.js';
|
import { tankopedia } from '../core/blitz/tankopedia';
|
||||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats.js';
|
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats';
|
||||||
import getPeriodNow from '../core/blitzstars/getPeriodNow.js';
|
import getPeriodNow from '../core/blitzstars/getPeriodNow';
|
||||||
import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo.js';
|
import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo';
|
||||||
import { tankAverages } from '../core/blitzstars/tankAverages.js';
|
import { tankAverages } from '../core/blitzstars/tankAverages';
|
||||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||||
import embedNegative from '../core/discord/embedNegative.js';
|
import embedNegative from '../core/discord/embedNegative';
|
||||||
import embedPositive from '../core/discord/embedPositive.js';
|
import embedPositive from '../core/discord/embedPositive';
|
||||||
import markdownTable, { TableInput } from '../core/discord/markdownTable.js';
|
import markdownTable, { TableInput } from '../core/discord/markdownTable';
|
||||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
import { AccountInfo } from '../types/accountInfo.js';
|
import { AccountInfo } from '../types/accountInfo';
|
||||||
import { PossiblyPromise } from '../types/possiblyPromise.js';
|
import { PossiblyPromise } from '../types/possiblyPromise';
|
||||||
|
|
||||||
export type SkilledClan = 'SKLLD' | 'SMRI';
|
export type SkilledClan = 'SKLLD' | 'SMRI';
|
||||||
|
|
||||||
|
|||||||
+18
-18
@@ -1,22 +1,22 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import { CYCLIC_API } from '../constants/cyclic.js';
|
import { CYCLIC_API } from '../constants/cyclic';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import resolveTankId from '../core/blitz/resolveTankId.js';
|
import resolveTankId from '../core/blitz/resolveTankId';
|
||||||
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups.js';
|
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups';
|
||||||
import autocompleteTanks from '../core/discord/autocompleteTanks.js';
|
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
||||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||||
import interactionToURL from '../core/discord/interactionToURL.js';
|
import interactionToURL from '../core/discord/interactionToURL';
|
||||||
import linkButton from '../core/discord/linkButton.js';
|
import linkButton from '../core/discord/linkButton';
|
||||||
import primaryButton from '../core/discord/primaryButton.js';
|
import primaryButton from '../core/discord/primaryButton';
|
||||||
import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton.js';
|
import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton';
|
||||||
import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand.js';
|
import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand';
|
||||||
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton.js';
|
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton';
|
||||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
import evolution from '../renderers/evolution.js';
|
import evolution from '../renderers/evolution';
|
||||||
import { StatType } from '../renderers/fullStats.js';
|
import { StatType } from '../renderers/fullStats';
|
||||||
import { AccountInfo } from '../types/accountInfo.js';
|
import { AccountInfo } from '../types/accountInfo';
|
||||||
|
|
||||||
export const evolutionCommand: CommandRegistry = {
|
export const evolutionCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
|
|||||||
+17
-17
@@ -1,21 +1,21 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import { CYCLIC_API } from '../constants/cyclic.js';
|
import { CYCLIC_API } from '../constants/cyclic';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import resolveTankId from '../core/blitz/resolveTankId.js';
|
import resolveTankId from '../core/blitz/resolveTankId';
|
||||||
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups.js';
|
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups';
|
||||||
import autocompleteTanks from '../core/discord/autocompleteTanks.js';
|
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
||||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||||
import interactionToURL from '../core/discord/interactionToURL.js';
|
import interactionToURL from '../core/discord/interactionToURL';
|
||||||
import linkButton from '../core/discord/linkButton.js';
|
import linkButton from '../core/discord/linkButton';
|
||||||
import primaryButton from '../core/discord/primaryButton.js';
|
import primaryButton from '../core/discord/primaryButton';
|
||||||
import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton.js';
|
import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton';
|
||||||
import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand.js';
|
import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand';
|
||||||
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton.js';
|
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton';
|
||||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
import fullStats, { StatType } from '../renderers/fullStats.js';
|
import fullStats, { StatType } from '../renderers/fullStats';
|
||||||
import { AccountInfo } from '../types/accountInfo.js';
|
import { AccountInfo } from '../types/accountInfo';
|
||||||
|
|
||||||
export const fullStatsCommand: CommandRegistry = {
|
export const fullStatsCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ import {
|
|||||||
SlashCommandBuilder,
|
SlashCommandBuilder,
|
||||||
SlashCommandSubcommandsOnlyBuilder,
|
SlashCommandSubcommandsOnlyBuilder,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import {
|
import { COMMANDS_RAW, CommandRegistry } from '../events/interactionCreate';
|
||||||
COMMANDS_RAW,
|
|
||||||
CommandRegistry,
|
|
||||||
} from '../events/interactionCreate/index.js';
|
|
||||||
|
|
||||||
const RAW_PATH = `https://raw.githubusercontent.com/tresabhi/blitzkrieg/main/docs/`;
|
const RAW_PATH = `https://raw.githubusercontent.com/tresabhi/blitzkrieg/main/docs/`;
|
||||||
const DOCS = {
|
const DOCS = {
|
||||||
|
|||||||
+14
-14
@@ -1,18 +1,18 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import GenericStats from '../components/GenericStats/index.js';
|
import GenericStats from '../components/GenericStats';
|
||||||
import NoData, { NoDataType } from '../components/NoData.js';
|
import NoData, { NoDataType } from '../components/NoData';
|
||||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy.js';
|
import PoweredBy, { PoweredByType } from '../components/PoweredBy';
|
||||||
import TitleBar from '../components/TitleBar.js';
|
import TitleBar from '../components/TitleBar';
|
||||||
import Wrapper from '../components/Wrapper.js';
|
import Wrapper from '../components/Wrapper';
|
||||||
import { BLITZ_SERVERS } from '../constants/servers.js';
|
import { BLITZ_SERVERS } from '../constants/servers';
|
||||||
import getBlitzClan from '../core/blitz/getBlitzClan.js';
|
import getBlitzClan from '../core/blitz/getBlitzClan';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import addClanChoices from '../core/discord/addClanChoices.js';
|
import addClanChoices from '../core/discord/addClanChoices';
|
||||||
import autocompleteClan from '../core/discord/autocompleteClan.js';
|
import autocompleteClan from '../core/discord/autocompleteClan';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
import { AccountInfo } from '../types/accountInfo.js';
|
import { AccountInfo } from '../types/accountInfo';
|
||||||
import { ClanInfo } from '../types/clanInfo.js';
|
import { ClanInfo } from '../types/clanInfo';
|
||||||
|
|
||||||
const DEFAULT_THRESHOLD = 7;
|
const DEFAULT_THRESHOLD = 7;
|
||||||
|
|
||||||
|
|||||||
+18
-18
@@ -1,26 +1,26 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import NoData, { NoDataType } from '../components/NoData.js';
|
import NoData, { NoDataType } from '../components/NoData';
|
||||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy.js';
|
import PoweredBy, { PoweredByType } from '../components/PoweredBy';
|
||||||
import * as Tanks from '../components/Tanks/index.js';
|
import * as Tanks from '../components/Tanks';
|
||||||
import TitleBar from '../components/TitleBar.js';
|
import TitleBar from '../components/TitleBar';
|
||||||
import Wrapper from '../components/Wrapper.js';
|
import Wrapper from '../components/Wrapper';
|
||||||
import { BLITZ_SERVERS } from '../constants/servers.js';
|
import { BLITZ_SERVERS } from '../constants/servers';
|
||||||
import getTankStats from '../core/blitz/getTankStats.js';
|
import getTankStats from '../core/blitz/getTankStats';
|
||||||
import getTreeType from '../core/blitz/getTreeType.js';
|
import getTreeType from '../core/blitz/getTreeType';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import resolveTankName from '../core/blitz/resolveTankName.js';
|
import resolveTankName from '../core/blitz/resolveTankName';
|
||||||
import {
|
import {
|
||||||
TIER_ROMAN_NUMERALS,
|
TIER_ROMAN_NUMERALS,
|
||||||
Tier,
|
Tier,
|
||||||
tankopedia,
|
tankopedia,
|
||||||
} from '../core/blitz/tankopedia.js';
|
} from '../core/blitz/tankopedia';
|
||||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
import { AccountInfo } from '../types/accountInfo.js';
|
import { AccountInfo } from '../types/accountInfo';
|
||||||
import { PlayerClanData } from '../types/playerClanData.js';
|
import { PlayerClanData } from '../types/playerClanData';
|
||||||
|
|
||||||
const COMP_TANKS = [
|
const COMP_TANKS = [
|
||||||
// light tanks
|
// light tanks
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
|
|
||||||
export const pingCommand: CommandRegistry<true> = {
|
export const pingCommand: CommandRegistry<true> = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
|
|||||||
@@ -1,18 +1,16 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import { startCase } from 'lodash';
|
import { startCase } from 'lodash';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||||
import embedInfo from '../core/discord/embedInfo.js';
|
import embedInfo from '../core/discord/embedInfo';
|
||||||
import markdownTable, {
|
import markdownTable, { TableInputEntry } from '../core/discord/markdownTable';
|
||||||
TableInputEntry,
|
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||||
} from '../core/discord/markdownTable.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { AccountAchievements } from '../types/accountAchievements';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { AccountInfo } from '../types/accountInfo';
|
||||||
import { AccountAchievements } from '../types/accountAchievements.js';
|
|
||||||
import { AccountInfo } from '../types/accountInfo.js';
|
|
||||||
|
|
||||||
type SortBy = 'name' | 'count';
|
type SortBy = 'name' | 'count';
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||||
import embedInfo from '../core/discord/embedInfo.js';
|
import embedInfo from '../core/discord/embedInfo';
|
||||||
import markdownTable from '../core/discord/markdownTable.js';
|
import markdownTable from '../core/discord/markdownTable';
|
||||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
import { AccountInfo } from '../types/accountInfo.js';
|
import { AccountInfo } from '../types/accountInfo';
|
||||||
|
|
||||||
export const playerInfoCommand: CommandRegistry = {
|
export const playerInfoCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js';
|
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import addClanChoices from '../core/discord/addClanChoices.js';
|
import addClanChoices from '../core/discord/addClanChoices';
|
||||||
import addServerChoices from '../core/discord/addServerChoices.js';
|
import addServerChoices from '../core/discord/addServerChoices';
|
||||||
import embedInfo from '../core/discord/embedInfo.js';
|
import embedInfo from '../core/discord/embedInfo';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
import { ClanList } from '../types/clanList.js';
|
import { ClanList } from '../types/clanList';
|
||||||
|
|
||||||
export const searchClansCommand: CommandRegistry = {
|
export const searchClansCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js';
|
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import { usernamePattern } from '../core/blitz/listPlayers.js';
|
import { usernamePattern } from '../core/blitz/listPlayers';
|
||||||
import addServerChoices from '../core/discord/addServerChoices.js';
|
import addServerChoices from '../core/discord/addServerChoices';
|
||||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||||
import embedInfo from '../core/discord/embedInfo.js';
|
import embedInfo from '../core/discord/embedInfo';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
import { AccountList } from '../types/accountList.js';
|
import { AccountList } from '../types/accountList';
|
||||||
|
|
||||||
export const searchPlayersCommand: CommandRegistry = {
|
export const searchPlayersCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import { go } from 'fuzzysort';
|
import { go } from 'fuzzysort';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import { TANK_NAMES } from '../core/blitz/tankopedia.js';
|
import { TANK_NAMES } from '../core/blitz/tankopedia';
|
||||||
import addTankChoices from '../core/discord/addTankChoices.js';
|
import addTankChoices from '../core/discord/addTankChoices';
|
||||||
import embedInfo from '../core/discord/embedInfo.js';
|
import embedInfo from '../core/discord/embedInfo';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
|
|
||||||
export const searchTanksCommand: CommandRegistry = {
|
export const searchTanksCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
|
|||||||
+18
-18
@@ -1,22 +1,22 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import { CYCLIC_API } from '../constants/cyclic.js';
|
import { CYCLIC_API } from '../constants/cyclic';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import resolveTankId from '../core/blitz/resolveTankId.js';
|
import resolveTankId from '../core/blitz/resolveTankId';
|
||||||
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups.js';
|
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups';
|
||||||
import autocompleteTanks from '../core/discord/autocompleteTanks.js';
|
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
||||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||||
import interactionToURL from '../core/discord/interactionToURL.js';
|
import interactionToURL from '../core/discord/interactionToURL';
|
||||||
import linkButton from '../core/discord/linkButton.js';
|
import linkButton from '../core/discord/linkButton';
|
||||||
import primaryButton from '../core/discord/primaryButton.js';
|
import primaryButton from '../core/discord/primaryButton';
|
||||||
import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton.js';
|
import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton';
|
||||||
import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand.js';
|
import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand';
|
||||||
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton.js';
|
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton';
|
||||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
import { StatType } from '../renderers/fullStats.js';
|
import { StatType } from '../renderers/fullStats';
|
||||||
import stats from '../renderers/stats.js';
|
import stats from '../renderers/stats';
|
||||||
import { AccountInfo } from '../types/accountInfo.js';
|
import { AccountInfo } from '../types/accountInfo';
|
||||||
|
|
||||||
export const statsCommand: CommandRegistry = {
|
export const statsCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
|
|||||||
+13
-13
@@ -1,17 +1,17 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import { CYCLIC_API } from '../constants/cyclic.js';
|
import { CYCLIC_API } from '../constants/cyclic';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||||
import interactionToURL from '../core/discord/interactionToURL.js';
|
import interactionToURL from '../core/discord/interactionToURL';
|
||||||
import linkButton from '../core/discord/linkButton.js';
|
import linkButton from '../core/discord/linkButton';
|
||||||
import primaryButton from '../core/discord/primaryButton.js';
|
import primaryButton from '../core/discord/primaryButton';
|
||||||
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton.js';
|
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton';
|
||||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
import today from '../renderers/today.js';
|
import today from '../renderers/today';
|
||||||
import { AccountInfo } from '../types/accountInfo.js';
|
import { AccountInfo } from '../types/accountInfo';
|
||||||
|
|
||||||
export const todayCommand: CommandRegistry = {
|
export const todayCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
|
|||||||
+10
-10
@@ -1,16 +1,16 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import discord from '../../discord.json' assert { type: 'json' };
|
import discord from '../../discord.json' assert { type: 'json' };
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||||
import embedNegative from '../core/discord/embedNegative.js';
|
import embedNegative from '../core/discord/embedNegative';
|
||||||
import embedPositive from '../core/discord/embedPositive.js';
|
import embedPositive from '../core/discord/embedPositive';
|
||||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
import { CommandRegistry } from '../events/interactionCreate';
|
||||||
import { AccountInfo } from '../types/accountInfo.js';
|
import { AccountInfo } from '../types/accountInfo';
|
||||||
import { PlayerClanData } from '../types/playerClanData.js';
|
import { PlayerClanData } from '../types/playerClanData';
|
||||||
|
|
||||||
export const verifyCommand: CommandRegistry = {
|
export const verifyCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Percentile } from '../../../../../constants/percentiles.js';
|
import { Percentile } from '../../../../../constants/percentiles';
|
||||||
import hslToHex from '../../../../../core/node/hslToHex.js';
|
import hslToHex from '../../../../../core/node/hslToHex';
|
||||||
import { PERCENTILE_COLORS } from '../../../../PercentileIndicator.js';
|
import { PERCENTILE_COLORS } from '../../../../PercentileIndicator';
|
||||||
|
|
||||||
export enum GlowSide {
|
export enum GlowSide {
|
||||||
Top,
|
Top,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Percentile } from '../../../../constants/percentiles.js';
|
import { Percentile } from '../../../../constants/percentiles';
|
||||||
import getWN8Percentile from '../../../../core/blitz/getWN8Percentile.js';
|
import getWN8Percentile from '../../../../core/blitz/getWN8Percentile';
|
||||||
import { theme } from '../../../../stitches.config.js';
|
import { theme } from '../../../../stitches.config';
|
||||||
import { PERCENTILE_COLORS } from '../../../PercentileIndicator.js';
|
import { PERCENTILE_COLORS } from '../../../PercentileIndicator';
|
||||||
import { Glow, GlowSide } from './components/Glow.js';
|
import { Glow, GlowSide } from './components/Glow';
|
||||||
|
|
||||||
export interface WN8DisplayProps {
|
export interface WN8DisplayProps {
|
||||||
WN8?: number;
|
WN8?: number;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { theme } from '../../../stitches.config.js';
|
import { theme } from '../../../stitches.config';
|
||||||
|
|
||||||
export enum WN8SurroundingStatAlign {
|
export enum WN8SurroundingStatAlign {
|
||||||
Left,
|
Left,
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { AllStats, SupplementaryStats } from '../../types/accountInfo.js';
|
import { AllStats, SupplementaryStats } from '../../types/accountInfo';
|
||||||
import { WN8Display } from './components/WN8Display/index.js';
|
import { WN8Display } from './components/WN8Display';
|
||||||
import {
|
import {
|
||||||
WN8SurroundingStat,
|
WN8SurroundingStat,
|
||||||
WN8SurroundingStatAlign,
|
WN8SurroundingStatAlign,
|
||||||
} from './components/WN8SurroundingStat.js';
|
} from './components/WN8SurroundingStat';
|
||||||
|
|
||||||
export interface AllStatsOverviewProps {
|
export interface AllStatsOverviewProps {
|
||||||
stats: AllStats;
|
stats: AllStats;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import getWN8Percentile from '../../../core/blitz/getWN8Percentile.js';
|
import getWN8Percentile from '../../../core/blitz/getWN8Percentile';
|
||||||
import { theme } from '../../../stitches.config.js';
|
import { theme } from '../../../stitches.config';
|
||||||
import { RowDiscriminator } from './RowDiscriminator.js';
|
import { RowDiscriminator } from './RowDiscriminator';
|
||||||
import { RowStat } from './RowStat.js';
|
import { RowStat } from './RowStat';
|
||||||
|
|
||||||
export interface RowProps {
|
export interface RowProps {
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { theme } from '../../../stitches.config.js';
|
import { theme } from '../../../stitches.config';
|
||||||
|
|
||||||
export interface RowDiscriminatorProps {
|
export interface RowDiscriminatorProps {
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Percentile } from '../../../constants/percentiles.js';
|
import { Percentile } from '../../../constants/percentiles';
|
||||||
import { theme } from '../../../stitches.config.js';
|
import { theme } from '../../../stitches.config';
|
||||||
import PercentileIndicator from '../../PercentileIndicator.js';
|
import PercentileIndicator from '../../PercentileIndicator';
|
||||||
|
|
||||||
export interface RowStatProps {
|
export interface RowStatProps {
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export * from './components/Root.js';
|
export * from './components/Root';
|
||||||
export * from './components/Row.js';
|
export * from './components/Row';
|
||||||
export * from './components/RowDiscriminator.js';
|
export * from './components/RowDiscriminator';
|
||||||
export * from './components/RowStat.js';
|
export * from './components/RowStat';
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Percentile } from '../../../constants/percentiles.js';
|
import { Percentile } from '../../../constants/percentiles';
|
||||||
import { theme } from '../../../stitches.config.js';
|
import { theme } from '../../../stitches.config';
|
||||||
import PercentileIndicator from '../../PercentileIndicator.js';
|
import PercentileIndicator from '../../PercentileIndicator';
|
||||||
|
|
||||||
export interface CardItem {
|
export interface CardItem {
|
||||||
label: string;
|
label: string;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import getWN8Percentile from '../../core/blitz/getWN8Percentile.js';
|
import getWN8Percentile from '../../core/blitz/getWN8Percentile';
|
||||||
import isNumber from '../../core/node/isNumber.js';
|
import isNumber from '../../core/node/isNumber';
|
||||||
import { AllStats, SupplementaryStats } from '../../types/accountInfo.js';
|
import { AllStats, SupplementaryStats } from '../../types/accountInfo';
|
||||||
import { Card } from './components/Card.js';
|
import { Card } from './components/Card';
|
||||||
import { Root } from './components/Root.js';
|
import { Root } from './components/Root';
|
||||||
import { Row } from './components/Row.js';
|
import { Row } from './components/Row';
|
||||||
|
|
||||||
// TODO: remove the .js endings
|
// TODO: remove the .js endings
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Stat } from '../index.js';
|
import { Stat } from '..';
|
||||||
import GenericStatsRow from './GenericStatsRow.js';
|
import GenericStatsRow from './GenericStatsRow';
|
||||||
|
|
||||||
export interface GenericStatsColumnProps {
|
export interface GenericStatsColumnProps {
|
||||||
stats: Stat[];
|
stats: Stat[];
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { theme } from '../../../stitches.config.js';
|
import { Stat } from '..';
|
||||||
import PercentileIndicator from '../../PercentileIndicator.js';
|
import { theme } from '../../../stitches.config';
|
||||||
import { Stat } from '../index.js';
|
import PercentileIndicator from '../../PercentileIndicator';
|
||||||
|
|
||||||
export interface GenericStatsRowProps {
|
export interface GenericStatsRowProps {
|
||||||
stat: Stat;
|
stat: Stat;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Percentile } from '../../constants/percentiles.js';
|
import { Percentile } from '../../constants/percentiles';
|
||||||
import GenericStatsColumn from './components/GenericStatsColumn.js';
|
import GenericStatsColumn from './components/GenericStatsColumn';
|
||||||
|
|
||||||
export type Stat =
|
export type Stat =
|
||||||
| [string, string | number | undefined]
|
| [string, string | number | undefined]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { blue, green, red, slateDark } from '@radix-ui/colors';
|
import { blue, green, red, slateDark } from '@radix-ui/colors';
|
||||||
import { GRAPH_HEIGHT, GRAPH_WIDTH } from './Root.js';
|
import { GRAPH_HEIGHT, GRAPH_WIDTH } from './Root';
|
||||||
|
|
||||||
export enum LineColor {
|
export enum LineColor {
|
||||||
Red,
|
Red,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { times } from 'lodash';
|
import { times } from 'lodash';
|
||||||
import { theme } from '../../../stitches.config.js';
|
import { theme } from '../../../stitches.config';
|
||||||
import { MarginInputProps } from './Root.js';
|
import { MarginInputProps } from './Root';
|
||||||
|
|
||||||
export enum MarginOrientation {
|
export enum MarginOrientation {
|
||||||
Vertical,
|
Vertical,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { times } from 'lodash';
|
import { times } from 'lodash';
|
||||||
import { ReactNode } from 'react';
|
import { ReactNode } from 'react';
|
||||||
import { theme } from '../../../stitches.config.js';
|
import { theme } from '../../../stitches.config';
|
||||||
import { Margin, MarginOrientation } from './Margin.js';
|
import { Margin, MarginOrientation } from './Margin';
|
||||||
|
|
||||||
export const GRAPH_WIDTH = 544;
|
export const GRAPH_WIDTH = 544;
|
||||||
export const GRAPH_HEIGHT = 320;
|
export const GRAPH_HEIGHT = 320;
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export * from './components/Line.js';
|
export * from './components/Line';
|
||||||
export * from './components/Margin.js';
|
export * from './components/Margin';
|
||||||
export * from './components/Root.js';
|
export * from './components/Root';
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { theme } from '../stitches.config.js';
|
import { theme } from '../stitches.config';
|
||||||
|
|
||||||
export enum NoDataType {
|
export enum NoDataType {
|
||||||
BattlesInPeriod,
|
BattlesInPeriod,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
teal,
|
teal,
|
||||||
yellow,
|
yellow,
|
||||||
} from '@radix-ui/colors';
|
} from '@radix-ui/colors';
|
||||||
import { Percentile } from '../constants/percentiles.js';
|
import { Percentile } from '../constants/percentiles';
|
||||||
|
|
||||||
export interface PercentileIndicatorProps {
|
export interface PercentileIndicatorProps {
|
||||||
percentile: Percentile;
|
percentile: Percentile;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ReactNode } from 'react';
|
import { ReactNode } from 'react';
|
||||||
import { theme } from '../stitches.config.js';
|
import { theme } from '../stitches.config';
|
||||||
|
|
||||||
export enum PoweredByType {
|
export enum PoweredByType {
|
||||||
BlitzStars,
|
BlitzStars,
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import {
|
|||||||
TANK_ICONS,
|
TANK_ICONS,
|
||||||
TANK_ICONS_COLLECTOR,
|
TANK_ICONS_COLLECTOR,
|
||||||
TANK_ICONS_PREMIUM,
|
TANK_ICONS_PREMIUM,
|
||||||
} from '../../../core/blitz/tankopedia.js';
|
} from '../../../core/blitz/tankopedia';
|
||||||
import { theme } from '../../../stitches.config.js';
|
import { theme } from '../../../stitches.config';
|
||||||
|
|
||||||
export enum TreeType {
|
export enum TreeType {
|
||||||
TechTree,
|
TechTree,
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export * from './components/Column.js';
|
export * from './components/Column';
|
||||||
export * from './components/Item.js';
|
export * from './components/Item';
|
||||||
export * from './components/Root.js';
|
export * from './components/Root';
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { TIER_ROMAN_NUMERALS, Tier } from '../core/blitz/tankopedia.js';
|
import { TIER_ROMAN_NUMERALS, Tier } from '../core/blitz/tankopedia';
|
||||||
import { theme } from '../stitches.config.js';
|
import { theme } from '../stitches.config';
|
||||||
|
|
||||||
export type TierWeightsRecord = Partial<Record<Tier, number>>;
|
export type TierWeightsRecord = Partial<Record<Tier, number>>;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import isDev from '../core/node/isDev.js';
|
import isDev from '../core/node/isDev';
|
||||||
import { theme } from '../stitches.config.js';
|
import { theme } from '../stitches.config';
|
||||||
|
|
||||||
export interface TitleBarProps {
|
export interface TitleBarProps {
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ReactNode } from 'react';
|
import { ReactNode } from 'react';
|
||||||
import { theme } from '../stitches.config.js';
|
import { theme } from '../stitches.config';
|
||||||
|
|
||||||
export interface WrapperProps {
|
export interface WrapperProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AllStats } from '../../types/accountInfo.js';
|
import { AllStats } from '../../types/accountInfo';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Formula from https://web.archive.org/web/20190105064817/http://wiki.wnefficiency.net/pages/WN8
|
* Formula from https://web.archive.org/web/20190105064817/http://wiki.wnefficiency.net/pages/WN8
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AllStats } from '../../types/accountInfo.js';
|
import { AllStats } from '../../types/accountInfo';
|
||||||
|
|
||||||
export default function diffStats(stats1: AllStats, stats2: AllStats) {
|
export default function diffStats(stats1: AllStats, stats2: AllStats) {
|
||||||
function diff(value: (allStats: AllStats) => number) {
|
function diff(value: (allStats: AllStats) => number) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
import { serverAndIdPattern } from '../discord/resolvePlayerFromCommand.js';
|
import { serverAndIdPattern } from '../discord/resolvePlayerFromCommand';
|
||||||
import throwError from '../node/throwError.js';
|
import throwError from '../node/throwError';
|
||||||
import listClans from './listClans.js';
|
import listClans from './listClans';
|
||||||
|
|
||||||
export default async function getBlitzClan(clan: string) {
|
export default async function getBlitzClan(clan: string) {
|
||||||
if (serverAndIdPattern.test(clan)) {
|
if (serverAndIdPattern.test(clan)) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { BLITZ_SERVERS, BlitzServer } from '../../constants/servers.js';
|
import { BLITZ_SERVERS, BlitzServer } from '../../constants/servers';
|
||||||
import { TanksStats } from '../../types/tanksStats.js';
|
import { TanksStats } from '../../types/tanksStats';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../node/arguments';
|
||||||
import throwError from '../node/throwError.js';
|
import throwError from '../node/throwError';
|
||||||
import getWargamingResponse from './getWargamingResponse.js';
|
import getWargamingResponse from './getWargamingResponse';
|
||||||
|
|
||||||
export default async function getTankStats(server: BlitzServer, id: number) {
|
export default async function getTankStats(server: BlitzServer, id: number) {
|
||||||
const tankStats = await getWargamingResponse<TanksStats>(
|
const tankStats = await getWargamingResponse<TanksStats>(
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { TreeType } from '../../components/Tanks/index.js';
|
import { TreeType } from '../../components/Tanks';
|
||||||
import { tankopedia } from './tankopedia.js';
|
import { tankopedia } from './tankopedia';
|
||||||
|
|
||||||
export default async function getTreeType(id: number) {
|
export default async function getTreeType(id: number) {
|
||||||
const entry = (await tankopedia)[id];
|
const entry = (await tankopedia)[id];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Percentile } from '../../constants/percentiles.js';
|
import { Percentile } from '../../constants/percentiles';
|
||||||
|
|
||||||
export const WN8_PERCENTILES: [number, Percentile][] = [
|
export const WN8_PERCENTILES: [number, Percentile][] = [
|
||||||
[0, Percentile.VeryBad],
|
[0, Percentile.VeryBad],
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import throwError from '../node/throwError.js';
|
import throwError from '../node/throwError';
|
||||||
|
|
||||||
export type WargamingResponse<Data extends object> =
|
export type WargamingResponse<Data extends object> =
|
||||||
| {
|
| {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
import { Clan, ClanList } from '../../types/clanList.js';
|
import { Clan, ClanList } from '../../types/clanList';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../node/arguments';
|
||||||
import getWargamingResponse from './getWargamingResponse.js';
|
import getWargamingResponse from './getWargamingResponse';
|
||||||
|
|
||||||
export type ClanListWithServer = (Clan & {
|
export type ClanListWithServer = (Clan & {
|
||||||
server: 'com' | 'eu' | 'asia';
|
server: 'com' | 'eu' | 'asia';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
import { Account, AccountList } from '../../types/accountList.js';
|
import { Account, AccountList } from '../../types/accountList';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../node/arguments';
|
||||||
import getWargamingResponse from './getWargamingResponse.js';
|
import getWargamingResponse from './getWargamingResponse';
|
||||||
|
|
||||||
export type AccountListWithServer = (Account & {
|
export type AccountListWithServer = (Account & {
|
||||||
server: 'com' | 'eu' | 'asia';
|
server: 'com' | 'eu' | 'asia';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { go } from 'fuzzysort';
|
import { go } from 'fuzzysort';
|
||||||
import throwError from '../node/throwError.js';
|
import throwError from '../node/throwError';
|
||||||
import { TANKS, tankopedia } from './tankopedia.js';
|
import { TANKS, tankopedia } from './tankopedia';
|
||||||
|
|
||||||
export default async function resolveTankId(tank: string) {
|
export default async function resolveTankId(tank: string) {
|
||||||
const number = parseInt(tank);
|
const number = parseInt(tank);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { tankopedia } from './tankopedia.js';
|
import { tankopedia } from './tankopedia';
|
||||||
|
|
||||||
export default async function resolveTankName(tankId: number) {
|
export default async function resolveTankName(tankId: number) {
|
||||||
const tankopediaName = (await tankopedia)[tankId]?.name;
|
const tankopediaName = (await tankopedia)[tankId]?.name;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { AllStats } from '../../types/accountInfo.js';
|
import { AllStats } from '../../types/accountInfo';
|
||||||
import { emptyAllStats } from '../blitzstars/getDiffedTankStats.js';
|
import { emptyAllStats } from '../blitzstars/getDiffedTankStats';
|
||||||
|
|
||||||
export default function sumStats(allStatsCollection: AllStats[]) {
|
export default function sumStats(allStatsCollection: AllStats[]) {
|
||||||
return allStatsCollection.reduce((accumulated, current) => {
|
return allStatsCollection.reduce((accumulated, current) => {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
import { AllStats } from '../../types/accountInfo.js';
|
import { AllStats } from '../../types/accountInfo';
|
||||||
import getTankHistories, {
|
import getTankHistories, {
|
||||||
TankHistories,
|
TankHistories,
|
||||||
TankHistoryRaw,
|
TankHistoryRaw,
|
||||||
} from './getTankHistories.js';
|
} from './getTankHistories';
|
||||||
|
|
||||||
export const emptyAllStats: AllStats = {
|
export const emptyAllStats: AllStats = {
|
||||||
battles: 0,
|
battles: 0,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
import { Period } from '../discord/addPeriodSubCommands.js';
|
import { Period } from '../discord/addPeriodSubCommands';
|
||||||
import getTimeDaysAgo from './getTimeDaysAgo.js';
|
import getTimeDaysAgo from './getTimeDaysAgo';
|
||||||
|
|
||||||
export default function getPeriodStart(
|
export default function getPeriodStart(
|
||||||
server: BlitzServer,
|
server: BlitzServer,
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
import { AccountInfo, AllStats } from '../../types/accountInfo.js';
|
import { AccountInfo, AllStats } from '../../types/accountInfo';
|
||||||
import {
|
import {
|
||||||
GetHistoriesOptions,
|
GetHistoriesOptions,
|
||||||
Histories,
|
Histories,
|
||||||
History,
|
History,
|
||||||
getHistoriesDefaultOptions,
|
getHistoriesDefaultOptions,
|
||||||
} from '../../types/histories.js';
|
} from '../../types/histories';
|
||||||
import getWargamingResponse from '../blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../blitz/getWargamingResponse';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../node/arguments';
|
||||||
import { emptyAllStats } from './getDiffedTankStats.js';
|
import { emptyAllStats } from './getDiffedTankStats';
|
||||||
|
|
||||||
export interface PlayerHistoryRaw {
|
export interface PlayerHistoryRaw {
|
||||||
clan: { clan_id: number; name: string; tag: string };
|
clan: { clan_id: number; name: string; tag: string };
|
||||||
@@ -44,7 +44,7 @@ export default async function getPlayerHistories(
|
|||||||
({
|
({
|
||||||
all: history.statistics.all,
|
all: history.statistics.all,
|
||||||
last_battle_time: history.last_battle_time,
|
last_battle_time: history.last_battle_time,
|
||||||
} satisfies History),
|
}) satisfies History,
|
||||||
);
|
);
|
||||||
let lastNonCompliantIndex = -1;
|
let lastNonCompliantIndex = -1;
|
||||||
let hasCompliedOnce = false;
|
let hasCompliedOnce = false;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
import {
|
import {
|
||||||
GetHistoriesOptions,
|
GetHistoriesOptions,
|
||||||
Histories,
|
Histories,
|
||||||
History,
|
History,
|
||||||
getHistoriesDefaultOptions,
|
getHistoriesDefaultOptions,
|
||||||
} from '../../types/histories.js';
|
} from '../../types/histories';
|
||||||
import getTankStats from '../blitz/getTankStats.js';
|
import getTankStats from '../blitz/getTankStats';
|
||||||
import { emptyAllStats } from './getDiffedTankStats.js';
|
import { emptyAllStats } from './getDiffedTankStats';
|
||||||
|
|
||||||
export interface TankHistory extends History {
|
export interface TankHistory extends History {
|
||||||
tank_id: number;
|
tank_id: number;
|
||||||
@@ -48,7 +48,7 @@ export default async function getTankHistories(
|
|||||||
all: history.all,
|
all: history.all,
|
||||||
last_battle_time: history.last_battle_time,
|
last_battle_time: history.last_battle_time,
|
||||||
tank_id: history.tank_id,
|
tank_id: history.tank_id,
|
||||||
} satisfies TankHistory),
|
}) satisfies TankHistory,
|
||||||
);
|
);
|
||||||
const compliantTanks: number[] = [];
|
const compliantTanks: number[] = [];
|
||||||
const lastBattles: Record<number, number> = {};
|
const lastBattles: Record<number, number> = {};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
|
|
||||||
export const TIME_ZONE_MAPPINGS: Record<BlitzServer, number> = {
|
export const TIME_ZONE_MAPPINGS: Record<BlitzServer, number> = {
|
||||||
com: -5, // Central North American Time
|
com: -5, // Central North American Time
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import sumStats from '../blitz/sumStats.js';
|
import sumStats from '../blitz/sumStats';
|
||||||
import { emptyAllStats } from './getDiffedTankStats.js';
|
import { emptyAllStats } from './getDiffedTankStats';
|
||||||
import { tankAverages } from './tankAverages.js';
|
import { tankAverages } from './tankAverages';
|
||||||
|
|
||||||
console.log('Calculating player average...');
|
console.log('Calculating player average...');
|
||||||
export const playerAverage = Object.entries(await tankAverages).reduce(
|
export const playerAverage = Object.entries(await tankAverages).reduce(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AllStats } from '../../types/accountInfo.js';
|
import { AllStats } from '../../types/accountInfo';
|
||||||
|
|
||||||
export interface SpecialStats {
|
export interface SpecialStats {
|
||||||
winrate: number;
|
winrate: number;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
SlashCommandSubcommandBuilder,
|
SlashCommandSubcommandBuilder,
|
||||||
SlashCommandSubcommandGroupBuilder,
|
SlashCommandSubcommandGroupBuilder,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { PERIOD_NAMES } from '../discord/resolvePeriodFromCommand.js';
|
import { PERIOD_NAMES } from '../discord/resolvePeriodFromCommand';
|
||||||
|
|
||||||
export type Period = 'today' | '30' | '60' | '90' | 'career' | 'custom';
|
export type Period = 'today' | '30' | '60' | '90' | 'career' | 'custom';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { SlashCommandStringOption } from 'discord.js';
|
import { SlashCommandStringOption } from 'discord.js';
|
||||||
import { BLITZ_SERVERS } from '../../constants/servers.js';
|
import { BLITZ_SERVERS } from '../../constants/servers';
|
||||||
|
|
||||||
export default function addServerChoices(option: SlashCommandStringOption) {
|
export default function addServerChoices(option: SlashCommandStringOption) {
|
||||||
return option
|
return option
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
import addPeriodSubCommands from './addPeriodSubCommands.js';
|
import addPeriodSubCommands from './addPeriodSubCommands';
|
||||||
import addTankChoices from './addTankChoices.js';
|
import addTankChoices from './addTankChoices';
|
||||||
import addUsernameChoices from './addUsernameChoices.js';
|
import addUsernameChoices from './addUsernameChoices';
|
||||||
|
|
||||||
export default function addStatTypeSubCommandGroups(
|
export default function addStatTypeSubCommandGroups(
|
||||||
option: SlashCommandBuilder,
|
option: SlashCommandBuilder,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import {
|
|||||||
AutocompleteInteraction,
|
AutocompleteInteraction,
|
||||||
CacheType,
|
CacheType,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { BLITZ_SERVERS } from '../../constants/servers.js';
|
import { BLITZ_SERVERS } from '../../constants/servers';
|
||||||
import listClans from '../blitz/listClans.js';
|
import listClans from '../blitz/listClans';
|
||||||
|
|
||||||
export default async function autocompleteClan(
|
export default async function autocompleteClan(
|
||||||
interaction: AutocompleteInteraction<CacheType>,
|
interaction: AutocompleteInteraction<CacheType>,
|
||||||
@@ -20,7 +20,7 @@ export default async function autocompleteClan(
|
|||||||
({
|
({
|
||||||
name: `${player.name} (${BLITZ_SERVERS[player.server]})`,
|
name: `${player.name} (${BLITZ_SERVERS[player.server]})`,
|
||||||
value: `${player.server}/${player.clan_id}`,
|
value: `${player.server}/${player.clan_id}`,
|
||||||
} satisfies ApplicationCommandOptionChoiceData<string>),
|
}) satisfies ApplicationCommandOptionChoiceData<string>,
|
||||||
)
|
)
|
||||||
: [],
|
: [],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import {
|
|||||||
CacheType,
|
CacheType,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { go } from 'fuzzysort';
|
import { go } from 'fuzzysort';
|
||||||
import resolveTankName from '../blitz/resolveTankName.js';
|
import resolveTankName from '../blitz/resolveTankName';
|
||||||
import { TANKS } from '../blitz/tankopedia.js';
|
import { TANKS } from '../blitz/tankopedia';
|
||||||
|
|
||||||
export default async function autocompleteTanks(
|
export default async function autocompleteTanks(
|
||||||
interaction: AutocompleteInteraction<CacheType>,
|
interaction: AutocompleteInteraction<CacheType>,
|
||||||
@@ -16,14 +16,17 @@ export default async function autocompleteTanks(
|
|||||||
await interaction.respond(
|
await interaction.respond(
|
||||||
focusedOption.value
|
focusedOption.value
|
||||||
? await Promise.all(
|
? await Promise.all(
|
||||||
go(focusedOption.value, await TANKS, { keys: ['name'], limit: 10 }).map(
|
go(focusedOption.value, await TANKS, {
|
||||||
|
keys: ['name'],
|
||||||
|
limit: 10,
|
||||||
|
}).map(
|
||||||
async (item) =>
|
async (item) =>
|
||||||
({
|
({
|
||||||
name: item.obj.name
|
name: item.obj.name
|
||||||
? item.obj.name
|
? item.obj.name
|
||||||
: await resolveTankName(item.obj.tank_id),
|
: await resolveTankName(item.obj.tank_id),
|
||||||
value: `${item.obj.tank_id}`,
|
value: `${item.obj.tank_id}`,
|
||||||
} satisfies ApplicationCommandOptionChoiceData<string>),
|
}) satisfies ApplicationCommandOptionChoiceData<string>,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: [],
|
: [],
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import {
|
|||||||
AutocompleteInteraction,
|
AutocompleteInteraction,
|
||||||
CacheType,
|
CacheType,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { BLITZ_SERVERS } from '../../constants/servers.js';
|
import { BLITZ_SERVERS } from '../../constants/servers';
|
||||||
import listPlayers from '../blitz/listPlayers.js';
|
import listPlayers from '../blitz/listPlayers';
|
||||||
|
|
||||||
export default async function autocompleteUsername(
|
export default async function autocompleteUsername(
|
||||||
interaction: AutocompleteInteraction<CacheType>,
|
interaction: AutocompleteInteraction<CacheType>,
|
||||||
@@ -21,7 +21,7 @@ export default async function autocompleteUsername(
|
|||||||
({
|
({
|
||||||
name: `${player.nickname} (${BLITZ_SERVERS[player.server]})`,
|
name: `${player.nickname} (${BLITZ_SERVERS[player.server]})`,
|
||||||
value: `${player.server}/${player.account_id}`,
|
value: `${player.server}/${player.account_id}`,
|
||||||
} satisfies ApplicationCommandOptionChoiceData<string>),
|
}) satisfies ApplicationCommandOptionChoiceData<string>,
|
||||||
)
|
)
|
||||||
: [],
|
: [],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { EmbedBuilder } from 'discord.js';
|
import { EmbedBuilder } from 'discord.js';
|
||||||
import { ACCENT_COLOR } from '../../constants/colors.js';
|
import { ACCENT_COLOR } from '../../constants/colors';
|
||||||
|
|
||||||
export default function embedInfo(title: string, description: string) {
|
export default function embedInfo(title: string, description: string) {
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { EmbedBuilder } from 'discord.js';
|
import { EmbedBuilder } from 'discord.js';
|
||||||
import { NEGATIVE_COLOR } from '../../constants/colors.js';
|
import { NEGATIVE_COLOR } from '../../constants/colors';
|
||||||
|
|
||||||
export default function embedNegative(title: string, description: string) {
|
export default function embedNegative(title: string, description: string) {
|
||||||
return new EmbedBuilder()
|
return new EmbedBuilder()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { EmbedBuilder } from 'discord.js';
|
import { EmbedBuilder } from 'discord.js';
|
||||||
import { POSITIVE_COLOR } from '../../constants/colors.js';
|
import { POSITIVE_COLOR } from '../../constants/colors';
|
||||||
|
|
||||||
export default function embedPositive(title: string, description: string) {
|
export default function embedPositive(title: string, description: string) {
|
||||||
return new EmbedBuilder()
|
return new EmbedBuilder()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { EmbedBuilder } from 'discord.js';
|
import { EmbedBuilder } from 'discord.js';
|
||||||
import { WARNING_COLOR } from '../../constants/colors.js';
|
import { WARNING_COLOR } from '../../constants/colors';
|
||||||
|
|
||||||
export default function embedWarning(title: string, description: string) {
|
export default function embedWarning(title: string, description: string) {
|
||||||
return new EmbedBuilder()
|
return new EmbedBuilder()
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import {
|
|||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
InteractionEditReplyOptions,
|
InteractionEditReplyOptions,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { InteractionReturnable } from '../../events/interactionCreate/index.js';
|
import { InteractionReturnable } from '../../events/interactionCreate';
|
||||||
import jsxToPng from '../node/jsxToPng.js';
|
import jsxToPng from '../node/jsxToPng';
|
||||||
|
|
||||||
export default async function normalizeInteractionReturnable(
|
export default async function normalizeInteractionReturnable(
|
||||||
returnable: InteractionReturnable,
|
returnable: InteractionReturnable,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ButtonInteraction, CacheType } from 'discord.js';
|
import { ButtonInteraction, CacheType } from 'discord.js';
|
||||||
import { CYCLIC_API } from '../../constants/cyclic.js';
|
import { CYCLIC_API } from '../../constants/cyclic';
|
||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
import resolvePeriodFromURL from '../express/resolvePeriodFromURL.js';
|
import resolvePeriodFromURL from '../express/resolvePeriodFromURL';
|
||||||
|
|
||||||
export default function resolvePeriodFromButton(
|
export default function resolvePeriodFromButton(
|
||||||
server: BlitzServer,
|
server: BlitzServer,
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
import getPeriodNow from '../blitzstars/getPeriodNow.js';
|
import getPeriodNow from '../blitzstars/getPeriodNow';
|
||||||
import getPeriodStart from '../blitzstars/getPeriodStart.js';
|
import getPeriodStart from '../blitzstars/getPeriodStart';
|
||||||
import getTimeDaysAgo from '../blitzstars/getTimeDaysAgo.js';
|
import getTimeDaysAgo from '../blitzstars/getTimeDaysAgo';
|
||||||
import { Period } from '../discord/addPeriodSubCommands.js';
|
import { Period } from '../discord/addPeriodSubCommands';
|
||||||
|
|
||||||
export const PERIOD_NAMES: Record<Period, string> = {
|
export const PERIOD_NAMES: Record<Period, string> = {
|
||||||
today: "Today's statistics",
|
today: "Today's statistics",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ButtonInteraction, CacheType } from 'discord.js';
|
import { ButtonInteraction, CacheType } from 'discord.js';
|
||||||
import { CYCLIC_API } from '../../constants/cyclic.js';
|
import { CYCLIC_API } from '../../constants/cyclic';
|
||||||
import resolvePlayerFromURL from '../express/resolvePlayerFromURL.js';
|
import resolvePlayerFromURL from '../express/resolvePlayerFromURL';
|
||||||
|
|
||||||
export default async function resolvePlayerFromButton(
|
export default async function resolvePlayerFromButton(
|
||||||
interaction: ButtonInteraction<CacheType>,
|
interaction: ButtonInteraction<CacheType>,
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
import listPlayers, {
|
import listPlayers, {
|
||||||
usernamePatternWithoutPosition,
|
usernamePatternWithoutPosition,
|
||||||
} from '../blitz/listPlayers.js';
|
} from '../blitz/listPlayers';
|
||||||
import throwError from '../node/throwError.js';
|
import throwError from '../node/throwError';
|
||||||
|
|
||||||
export const serverAndIdPattern = /(com|eu|asia)\/[0-9]+/;
|
export const serverAndIdPattern = /(com|eu|asia)\/[0-9]+/;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { RouteReturnable } from '../../server.js';
|
import { RouteReturnable } from '../../server';
|
||||||
import jsxToSvg from '../node/jsxToSvg.js';
|
import jsxToSvg from '../node/jsxToSvg';
|
||||||
|
|
||||||
export default async function normalizeRouteReturnable(
|
export default async function normalizeRouteReturnable(
|
||||||
returnable: RouteReturnable,
|
returnable: RouteReturnable,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import { CYCLIC_API } from '../../constants/cyclic.js';
|
import { CYCLIC_API } from '../../constants/cyclic';
|
||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
import resolvePeriodFromURL from './resolvePeriodFromURL.js';
|
import resolvePeriodFromURL from './resolvePeriodFromURL';
|
||||||
|
|
||||||
export default function resolvePeriodFromRequest(
|
export default function resolvePeriodFromRequest(
|
||||||
server: BlitzServer,
|
server: BlitzServer,
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
import getPeriodNow from '../blitzstars/getPeriodNow.js';
|
import getPeriodNow from '../blitzstars/getPeriodNow';
|
||||||
import getPeriodStart from '../blitzstars/getPeriodStart.js';
|
import getPeriodStart from '../blitzstars/getPeriodStart';
|
||||||
import getTimeDaysAgo from '../blitzstars/getTimeDaysAgo.js';
|
import getTimeDaysAgo from '../blitzstars/getTimeDaysAgo';
|
||||||
import { Period } from '../discord/addPeriodSubCommands.js';
|
import { Period } from '../discord/addPeriodSubCommands';
|
||||||
import {
|
import {
|
||||||
EVOLUTION_PERIOD_NAMES,
|
EVOLUTION_PERIOD_NAMES,
|
||||||
PERIOD_NAMES,
|
PERIOD_NAMES,
|
||||||
ResolvedPeriod,
|
ResolvedPeriod,
|
||||||
} from '../discord/resolvePeriodFromCommand.js';
|
} from '../discord/resolvePeriodFromCommand';
|
||||||
|
|
||||||
export default function resolvePeriodFromURL(
|
export default function resolvePeriodFromURL(
|
||||||
server: BlitzServer,
|
server: BlitzServer,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import { CYCLIC_API } from '../../constants/cyclic.js';
|
import { CYCLIC_API } from '../../constants/cyclic';
|
||||||
import resolvePlayerFromURL from './resolvePlayerFromURL.js';
|
import resolvePlayerFromURL from './resolvePlayerFromURL';
|
||||||
|
|
||||||
export default function resolvePlayerFromRequest(request: Request) {
|
export default function resolvePlayerFromRequest(request: Request) {
|
||||||
return resolvePlayerFromURL(`${CYCLIC_API}${request.originalUrl}`);
|
return resolvePlayerFromURL(`${CYCLIC_API}${request.originalUrl}`);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { BlitzServer } from '../../constants/servers.js';
|
import { BlitzServer } from '../../constants/servers';
|
||||||
import { ResolvedPlayer } from '../discord/resolvePlayerFromCommand.js';
|
import { ResolvedPlayer } from '../discord/resolvePlayerFromCommand';
|
||||||
|
|
||||||
export default function resolvePlayerFromURL(urlString: string) {
|
export default function resolvePlayerFromURL(urlString: string) {
|
||||||
const url = new URL(urlString);
|
const url = new URL(urlString);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import discord from '../../../discord.json' assert { type: 'json' };
|
import discord from '../../../discord.json' assert { type: 'json' };
|
||||||
import isDev from './isDev.js';
|
import isDev from './isDev';
|
||||||
|
|
||||||
export default function getClientId() {
|
export default function getClientId() {
|
||||||
return isDev() ? discord.client_id_dev : discord.client_id;
|
return isDev() ? discord.client_id_dev : discord.client_id;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import jsxToSvg from './jsxToSvg.js';
|
import jsxToSvg from './jsxToSvg';
|
||||||
import svgToPng from './svgToPng.js';
|
import svgToPng from './svgToPng';
|
||||||
|
|
||||||
export default async function jsxToPng(jsx: JSX.Element) {
|
export default async function jsxToPng(jsx: JSX.Element) {
|
||||||
const svg = await jsxToSvg(jsx);
|
const svg = await jsxToSvg(jsx);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Resvg } from "@resvg/resvg-js";
|
import { Resvg } from '@resvg/resvg-js';
|
||||||
|
|
||||||
export default function svgToPng(svg: string) {
|
export default function svgToPng(svg: string) {
|
||||||
return new Resvg(svg).render().asPng()
|
return new Resvg(svg).render().asPng();
|
||||||
}
|
}
|
||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
import { EmbedBuilder, TextChannel } from 'discord.js';
|
import { EmbedBuilder, TextChannel } from 'discord.js';
|
||||||
import discord from '../../discord.json' assert { type: 'json' };
|
import discord from '../../discord.json' assert { type: 'json' };
|
||||||
import { client } from '../bot.js';
|
import { client } from '../bot';
|
||||||
import { NEGATIVE_COLOR } from '../constants/colors.js';
|
import { NEGATIVE_COLOR } from '../constants/colors';
|
||||||
import isDev from '../core/node/isDev.js';
|
import isDev from '../core/node/isDev';
|
||||||
|
|
||||||
const PROCESS_ERROR_EVENTS = ['uncaughtException'];
|
const PROCESS_ERROR_EVENTS = ['uncaughtException'];
|
||||||
const CLIENT_ERROR_EVENTS = ['error'];
|
const CLIENT_ERROR_EVENTS = ['error'];
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { EmbedBuilder, GuildMember, TextChannel } from 'discord.js';
|
import { EmbedBuilder, GuildMember, TextChannel } from 'discord.js';
|
||||||
import discord from '../../discord.json' assert { type: 'json' };
|
import discord from '../../discord.json' assert { type: 'json' };
|
||||||
import { ACCENT_COLOR } from '../constants/colors.js';
|
import { ACCENT_COLOR } from '../constants/colors';
|
||||||
|
|
||||||
export default async function (member: GuildMember) {
|
export default async function (member: GuildMember) {
|
||||||
if (member.guild.id === discord.sklld_guild_id) {
|
if (member.guild.id === discord.sklld_guild_id) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { AutocompleteInteraction, CacheType } from 'discord.js';
|
import { AutocompleteInteraction, CacheType } from 'discord.js';
|
||||||
import { commands } from '../index.js';
|
import { commands } from '..';
|
||||||
|
|
||||||
export default function handleAutocomplete(
|
export default function handleAutocomplete(
|
||||||
interaction: AutocompleteInteraction<CacheType>,
|
interaction: AutocompleteInteraction<CacheType>,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { ButtonInteraction, CacheType } from 'discord.js';
|
import { ButtonInteraction, CacheType } from 'discord.js';
|
||||||
import { CYCLIC_API } from '../../../constants/cyclic.js';
|
import { commands } from '..';
|
||||||
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable.js';
|
import { CYCLIC_API } from '../../../constants/cyclic';
|
||||||
import throwError from '../../../core/node/throwError.js';
|
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable';
|
||||||
import { commands } from '../index.js';
|
import throwError from '../../../core/node/throwError';
|
||||||
|
|
||||||
export default async function handleButton(
|
export default async function handleButton(
|
||||||
interaction: ButtonInteraction<CacheType>,
|
interaction: ButtonInteraction<CacheType>,
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import {
|
|||||||
CacheType,
|
CacheType,
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import embedNegative from '../../../core/discord/embedNegative.js';
|
import { commands } from '..';
|
||||||
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable.js';
|
import embedNegative from '../../../core/discord/embedNegative';
|
||||||
import embedWarning from '../../../core/discord/embedWarning.js';
|
import embedWarning from '../../../core/discord/embedWarning';
|
||||||
import { psa } from '../../../core/discord/psa.js';
|
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable';
|
||||||
import { handleError } from '../../error.js';
|
import { psa } from '../../../core/discord/psa';
|
||||||
import { commands } from '../index.js';
|
import { handleError } from '../../error';
|
||||||
|
|
||||||
export default async function handleChatInputCommand(
|
export default async function handleChatInputCommand(
|
||||||
interaction: ChatInputCommandInteraction<CacheType>,
|
interaction: ChatInputCommandInteraction<CacheType>,
|
||||||
|
|||||||
@@ -13,28 +13,28 @@ import {
|
|||||||
SlashCommandSubcommandsOnlyBuilder,
|
SlashCommandSubcommandsOnlyBuilder,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import discord from '../../../discord.json' assert { type: 'json' };
|
import discord from '../../../discord.json' assert { type: 'json' };
|
||||||
import { debugCommand } from '../../commands/debug.js';
|
import { debugCommand } from '../../commands/debug';
|
||||||
import { eligibleCommand } from '../../commands/eligible.js';
|
import { eligibleCommand } from '../../commands/eligible';
|
||||||
import { evolutionCommand } from '../../commands/evolution.js';
|
import { evolutionCommand } from '../../commands/evolution';
|
||||||
import { fullStatsCommand } from '../../commands/fullStats.js';
|
import { fullStatsCommand } from '../../commands/fullStats';
|
||||||
import { helpCommand } from '../../commands/help.js';
|
import { helpCommand } from '../../commands/help';
|
||||||
import { inactiveCommand } from '../../commands/inactive.js';
|
import { inactiveCommand } from '../../commands/inactive';
|
||||||
import { ownedTanksCommand } from '../../commands/ownedTanks.js';
|
import { ownedTanksCommand } from '../../commands/ownedTanks';
|
||||||
import { pingCommand } from '../../commands/ping.js';
|
import { pingCommand } from '../../commands/ping';
|
||||||
import { playerAchievementsCommand } from '../../commands/playerAchievements.js';
|
import { playerAchievementsCommand } from '../../commands/playerAchievements';
|
||||||
import { playerInfoCommand } from '../../commands/playerInfo.js';
|
import { playerInfoCommand } from '../../commands/playerInfo';
|
||||||
import { searchClansCommand } from '../../commands/searchClans.js';
|
import { searchClansCommand } from '../../commands/searchClans';
|
||||||
import { searchPlayersCommand } from '../../commands/searchPlayers.js';
|
import { searchPlayersCommand } from '../../commands/searchPlayers';
|
||||||
import { searchTanksCommand } from '../../commands/searchTanks.js';
|
import { searchTanksCommand } from '../../commands/searchTanks';
|
||||||
import { statsCommand } from '../../commands/stats.js';
|
import { statsCommand } from '../../commands/stats';
|
||||||
import { todayCommand } from '../../commands/today.js';
|
import { todayCommand } from '../../commands/today';
|
||||||
import { verifyCommand } from '../../commands/verify.js';
|
import { verifyCommand } from '../../commands/verify';
|
||||||
import { DISCORD_TOKEN } from '../../core/node/arguments.js';
|
import { DISCORD_TOKEN } from '../../core/node/arguments';
|
||||||
import getClientId from '../../core/node/getClientId.js';
|
import getClientId from '../../core/node/getClientId';
|
||||||
import isDev from '../../core/node/isDev.js';
|
import isDev from '../../core/node/isDev';
|
||||||
import handleAutocomplete from './handlers/autocomplete.js';
|
import handleAutocomplete from './handlers/autocomplete';
|
||||||
import handleButton from './handlers/button.js';
|
import handleButton from './handlers/button';
|
||||||
import handleChatInputCommand from './handlers/chatInputCommand.js';
|
import handleChatInputCommand from './handlers/chatInputCommand';
|
||||||
|
|
||||||
export type InteractionRawReturnable =
|
export type InteractionRawReturnable =
|
||||||
| string
|
| string
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import { Client } from 'discord.js';
|
import { Client } from 'discord.js';
|
||||||
import isDev from '../core/node/isDev.js';
|
import isDev from '../core/node/isDev';
|
||||||
|
|
||||||
export default function ready(client: Client<true>) {
|
export default function ready(client: Client<true>) {
|
||||||
console.log(
|
console.log(
|
||||||
|
|||||||
+18
-18
@@ -1,21 +1,21 @@
|
|||||||
import * as Graph from '../components/Graph/index.js';
|
import * as Graph from '../components/Graph';
|
||||||
import NoData, { NoDataType } from '../components/NoData.js';
|
import NoData, { NoDataType } from '../components/NoData';
|
||||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy.js';
|
import PoweredBy, { PoweredByType } from '../components/PoweredBy';
|
||||||
import TitleBar from '../components/TitleBar.js';
|
import TitleBar from '../components/TitleBar';
|
||||||
import Wrapper from '../components/Wrapper.js';
|
import Wrapper from '../components/Wrapper';
|
||||||
import { BLITZ_SERVERS } from '../constants/servers.js';
|
import { BLITZ_SERVERS } from '../constants/servers';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import resolveTankName from '../core/blitz/resolveTankName.js';
|
import resolveTankName from '../core/blitz/resolveTankName';
|
||||||
import { tankopedia } from '../core/blitz/tankopedia.js';
|
import { tankopedia } from '../core/blitz/tankopedia';
|
||||||
import getPlayerHistories from '../core/blitzstars/getPlayerHistories.js';
|
import getPlayerHistories from '../core/blitzstars/getPlayerHistories';
|
||||||
import getTankHistories from '../core/blitzstars/getTankHistories.js';
|
import getTankHistories from '../core/blitzstars/getTankHistories';
|
||||||
import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand.js';
|
import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand';
|
||||||
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand.js';
|
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { AccountInfo } from '../types/accountInfo.js';
|
import { AccountInfo } from '../types/accountInfo';
|
||||||
import { Histories } from '../types/histories.js';
|
import { Histories } from '../types/histories';
|
||||||
import { PlayerClanData } from '../types/playerClanData.js';
|
import { PlayerClanData } from '../types/playerClanData';
|
||||||
import { StatType } from './fullStats.js';
|
import { StatType } from './fullStats';
|
||||||
|
|
||||||
export default async function evolution<Type extends StatType>(
|
export default async function evolution<Type extends StatType>(
|
||||||
type: Type,
|
type: Type,
|
||||||
|
|||||||
+20
-20
@@ -1,27 +1,27 @@
|
|||||||
import GenericAllStats from '../components/GenericAllStats/index.js';
|
import GenericAllStats from '../components/GenericAllStats';
|
||||||
import NoData, { NoDataType } from '../components/NoData.js';
|
import NoData, { NoDataType } from '../components/NoData';
|
||||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy.js';
|
import PoweredBy, { PoweredByType } from '../components/PoweredBy';
|
||||||
import TierWeights, { TierWeightsRecord } from '../components/TierWeights.js';
|
import TierWeights, { TierWeightsRecord } from '../components/TierWeights';
|
||||||
import TitleBar from '../components/TitleBar.js';
|
import TitleBar from '../components/TitleBar';
|
||||||
import Wrapper from '../components/Wrapper.js';
|
import Wrapper from '../components/Wrapper';
|
||||||
import { BLITZ_SERVERS } from '../constants/servers.js';
|
import { BLITZ_SERVERS } from '../constants/servers';
|
||||||
import calculateWN8 from '../core/blitz/calculateWN8.js';
|
import calculateWN8 from '../core/blitz/calculateWN8';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import resolveTankName from '../core/blitz/resolveTankName.js';
|
import resolveTankName from '../core/blitz/resolveTankName';
|
||||||
import sumStats from '../core/blitz/sumStats.js';
|
import sumStats from '../core/blitz/sumStats';
|
||||||
import { Tier, tankopedia } from '../core/blitz/tankopedia.js';
|
import { Tier, tankopedia } from '../core/blitz/tankopedia';
|
||||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats.js';
|
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats';
|
||||||
import { tankAverages } from '../core/blitzstars/tankAverages.js';
|
import { tankAverages } from '../core/blitzstars/tankAverages';
|
||||||
import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand.js';
|
import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand';
|
||||||
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand.js';
|
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import {
|
import {
|
||||||
AccountInfo,
|
AccountInfo,
|
||||||
AllStats,
|
AllStats,
|
||||||
SupplementaryStats,
|
SupplementaryStats,
|
||||||
} from '../types/accountInfo.js';
|
} from '../types/accountInfo';
|
||||||
import { PlayerClanData } from '../types/playerClanData.js';
|
import { PlayerClanData } from '../types/playerClanData';
|
||||||
import { PossiblyPromise } from '../types/possiblyPromise.js';
|
import { PossiblyPromise } from '../types/possiblyPromise';
|
||||||
|
|
||||||
export type StatType = 'player' | 'tank';
|
export type StatType = 'player' | 'tank';
|
||||||
|
|
||||||
|
|||||||
+21
-21
@@ -1,28 +1,28 @@
|
|||||||
import AllStatsOverview from '../components/AllStatsOverview/index.js';
|
import AllStatsOverview from '../components/AllStatsOverview';
|
||||||
import NoData, { NoDataType } from '../components/NoData.js';
|
import NoData, { NoDataType } from '../components/NoData';
|
||||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy.js';
|
import PoweredBy, { PoweredByType } from '../components/PoweredBy';
|
||||||
import { TierWeightsRecord } from '../components/TierWeights.js';
|
import { TierWeightsRecord } from '../components/TierWeights';
|
||||||
import TitleBar from '../components/TitleBar.js';
|
import TitleBar from '../components/TitleBar';
|
||||||
import Wrapper from '../components/Wrapper.js';
|
import Wrapper from '../components/Wrapper';
|
||||||
import { BLITZ_SERVERS } from '../constants/servers.js';
|
import { BLITZ_SERVERS } from '../constants/servers';
|
||||||
import calculateWN8 from '../core/blitz/calculateWN8.js';
|
import calculateWN8 from '../core/blitz/calculateWN8';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import resolveTankName from '../core/blitz/resolveTankName.js';
|
import resolveTankName from '../core/blitz/resolveTankName';
|
||||||
import sumStats from '../core/blitz/sumStats.js';
|
import sumStats from '../core/blitz/sumStats';
|
||||||
import { Tier, tankopedia } from '../core/blitz/tankopedia.js';
|
import { Tier, tankopedia } from '../core/blitz/tankopedia';
|
||||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats.js';
|
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats';
|
||||||
import { tankAverages } from '../core/blitzstars/tankAverages.js';
|
import { tankAverages } from '../core/blitzstars/tankAverages';
|
||||||
import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand.js';
|
import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand';
|
||||||
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand.js';
|
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { theme } from '../stitches.config.js';
|
import { theme } from '../stitches.config';
|
||||||
import {
|
import {
|
||||||
AccountInfo,
|
AccountInfo,
|
||||||
AllStats,
|
AllStats,
|
||||||
SupplementaryStats,
|
SupplementaryStats,
|
||||||
} from '../types/accountInfo.js';
|
} from '../types/accountInfo';
|
||||||
import { PlayerClanData } from '../types/playerClanData.js';
|
import { PlayerClanData } from '../types/playerClanData';
|
||||||
import { PossiblyPromise } from '../types/possiblyPromise.js';
|
import { PossiblyPromise } from '../types/possiblyPromise';
|
||||||
|
|
||||||
export type StatType = 'player' | 'tank';
|
export type StatType = 'player' | 'tank';
|
||||||
|
|
||||||
|
|||||||
+21
-21
@@ -1,24 +1,24 @@
|
|||||||
import * as Breakdown from '../components/Breakdown/index.js';
|
import * as Breakdown from '../components/Breakdown';
|
||||||
import NoData, { NoDataType } from '../components/NoData.js';
|
import NoData, { NoDataType } from '../components/NoData';
|
||||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy.js';
|
import PoweredBy, { PoweredByType } from '../components/PoweredBy';
|
||||||
import TitleBar from '../components/TitleBar.js';
|
import TitleBar from '../components/TitleBar';
|
||||||
import Wrapper from '../components/Wrapper.js';
|
import Wrapper from '../components/Wrapper';
|
||||||
import { BLITZ_SERVERS } from '../constants/servers.js';
|
import { BLITZ_SERVERS } from '../constants/servers';
|
||||||
import calculateWN8 from '../core/blitz/calculateWN8.js';
|
import calculateWN8 from '../core/blitz/calculateWN8';
|
||||||
import getTankStats from '../core/blitz/getTankStats.js';
|
import getTankStats from '../core/blitz/getTankStats';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||||
import resolveTankName from '../core/blitz/resolveTankName.js';
|
import resolveTankName from '../core/blitz/resolveTankName';
|
||||||
import sumStats from '../core/blitz/sumStats.js';
|
import sumStats from '../core/blitz/sumStats';
|
||||||
import { tankopedia } from '../core/blitz/tankopedia.js';
|
import { tankopedia } from '../core/blitz/tankopedia';
|
||||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats.js';
|
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats';
|
||||||
import getPeriodNow from '../core/blitzstars/getPeriodNow.js';
|
import getPeriodNow from '../core/blitzstars/getPeriodNow';
|
||||||
import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo.js';
|
import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo';
|
||||||
import { tankAverages } from '../core/blitzstars/tankAverages.js';
|
import { tankAverages } from '../core/blitzstars/tankAverages';
|
||||||
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand.js';
|
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||||
import { AccountInfo, AllStats } from '../types/accountInfo.js';
|
import { AccountInfo, AllStats } from '../types/accountInfo';
|
||||||
import { PlayerClanData } from '../types/playerClanData.js';
|
import { PlayerClanData } from '../types/playerClanData';
|
||||||
import { PossiblyPromise } from '../types/possiblyPromise.js';
|
import { PossiblyPromise } from '../types/possiblyPromise';
|
||||||
|
|
||||||
export default async function today(
|
export default async function today(
|
||||||
{ server, id }: ResolvedPlayer,
|
{ server, id }: ResolvedPlayer,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import resolvePeriodFromRequest from '../core/express/resolvePeriodFromRequest.js';
|
import resolvePeriodFromRequest from '../core/express/resolvePeriodFromRequest';
|
||||||
import resolvePlayerFromRequest from '../core/express/resolvePlayerFromRequest.js';
|
import resolvePlayerFromRequest from '../core/express/resolvePlayerFromRequest';
|
||||||
import stats, { StatType } from '../renderers/stats.js';
|
import stats, { StatType } from '../renderers/stats';
|
||||||
import { RouteRegistry } from '../server.js';
|
import { RouteRegistry } from '../server';
|
||||||
|
|
||||||
export const statsRoute: RouteRegistry = {
|
export const statsRoute: RouteRegistry = {
|
||||||
route: '/stats/:type/:period',
|
route: '/stats/:type/:period',
|
||||||
|
|||||||
Loaded 100 of 107 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user