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
108 files changed
+541
-533
No files matched your search
+11
-11
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
- Demonstrating empathy and kindness toward other people
|
||||
- Being respectful of differing opinions, viewpoints, and experiences
|
||||
- Giving and gracefully accepting constructive feedback
|
||||
- Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
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
|
||||
|
||||
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
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or email
|
||||
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
|
||||
|
||||
## Enforcement Responsibilities
|
||||
@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// https://vitepress.dev/guide/custom-theme
|
||||
import { h } from 'vue'
|
||||
import Theme from 'vitepress/theme'
|
||||
import './style.css'
|
||||
import { h } from 'vue';
|
||||
import Theme from 'vitepress/theme';
|
||||
import './style.css';
|
||||
|
||||
export default {
|
||||
extends: Theme,
|
||||
Layout: () => {
|
||||
return h(Theme.Layout, null, {
|
||||
// https://vitepress.dev/guide/extending-default-theme#layout-slots
|
||||
})
|
||||
});
|
||||
},
|
||||
enhanceApp({ app, router, siteData }) {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -7,7 +7,7 @@
|
||||
* Colors
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
:root {
|
||||
:root {
|
||||
--vp-c-brand: #646cff;
|
||||
--vp-c-brand-light: #747bff;
|
||||
--vp-c-brand-lighter: #9499ff;
|
||||
@@ -88,4 +88,3 @@
|
||||
.DocSearch {
|
||||
--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",
|
||||
"host:docs": "vitepress preview docs",
|
||||
"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",
|
||||
"dependencies": {
|
||||
@@ -42,6 +43,7 @@
|
||||
"@types/markdown-escape": "^1.1.0",
|
||||
"@types/node": "^20.2.1",
|
||||
"@types/react": "^18.2.7",
|
||||
"prettier": "^3.0.0",
|
||||
"typescript": "^5.0.4",
|
||||
"vitepress": "^1.0.0-beta.3"
|
||||
}
|
||||
|
||||
+5
-5
@@ -1,9 +1,9 @@
|
||||
import { Client, GatewayIntentBits } from 'discord.js';
|
||||
import { DISCORD_TOKEN } from './core/node/arguments.js';
|
||||
import { registerErrorHandlers } from './events/error.js';
|
||||
import guildMemberAdd from './events/guildMemberAdd.js';
|
||||
import interactionCreate from './events/interactionCreate/index.js';
|
||||
import ready from './events/ready.js';
|
||||
import { DISCORD_TOKEN } from './core/node/arguments';
|
||||
import { registerErrorHandlers } from './events/error';
|
||||
import guildMemberAdd from './events/guildMemberAdd';
|
||||
import interactionCreate from './events/interactionCreate';
|
||||
import ready from './events/ready';
|
||||
|
||||
export const client = new Client({
|
||||
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers],
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import packageJSON from '../../package.json' assert { type: 'json' };
|
||||
import { client } from '../bot.js';
|
||||
import { tankopedia } from '../core/blitz/tankopedia.js';
|
||||
import { tankAverages } from '../core/blitzstars/tankAverages.js';
|
||||
import embedInfo from '../core/discord/embedInfo.js';
|
||||
import markdownTable from '../core/discord/markdownTable.js';
|
||||
import getClientId from '../core/node/getClientId.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import { client } from '../bot';
|
||||
import { tankopedia } from '../core/blitz/tankopedia';
|
||||
import { tankAverages } from '../core/blitzstars/tankAverages';
|
||||
import embedInfo from '../core/discord/embedInfo';
|
||||
import markdownTable from '../core/discord/markdownTable';
|
||||
import getClientId from '../core/node/getClientId';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
|
||||
const executionStart = new Date().getTime();
|
||||
|
||||
|
||||
+17
-17
@@ -1,21 +1,21 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import calculateWN8 from '../core/blitz/calculateWN8.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import sumStats from '../core/blitz/sumStats.js';
|
||||
import { tankopedia } from '../core/blitz/tankopedia.js';
|
||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats.js';
|
||||
import getPeriodNow from '../core/blitzstars/getPeriodNow.js';
|
||||
import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo.js';
|
||||
import { tankAverages } from '../core/blitzstars/tankAverages.js';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
||||
import embedNegative from '../core/discord/embedNegative.js';
|
||||
import embedPositive from '../core/discord/embedPositive.js';
|
||||
import markdownTable, { TableInput } from '../core/discord/markdownTable.js';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import { AccountInfo } from '../types/accountInfo.js';
|
||||
import { PossiblyPromise } from '../types/possiblyPromise.js';
|
||||
import calculateWN8 from '../core/blitz/calculateWN8';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import sumStats from '../core/blitz/sumStats';
|
||||
import { tankopedia } from '../core/blitz/tankopedia';
|
||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats';
|
||||
import getPeriodNow from '../core/blitzstars/getPeriodNow';
|
||||
import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo';
|
||||
import { tankAverages } from '../core/blitzstars/tankAverages';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||
import embedNegative from '../core/discord/embedNegative';
|
||||
import embedPositive from '../core/discord/embedPositive';
|
||||
import markdownTable, { TableInput } from '../core/discord/markdownTable';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import { AccountInfo } from '../types/accountInfo';
|
||||
import { PossiblyPromise } from '../types/possiblyPromise';
|
||||
|
||||
export type SkilledClan = 'SKLLD' | 'SMRI';
|
||||
|
||||
|
||||
+18
-18
@@ -1,22 +1,22 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import { CYCLIC_API } from '../constants/cyclic.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import resolveTankId from '../core/blitz/resolveTankId.js';
|
||||
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups.js';
|
||||
import autocompleteTanks from '../core/discord/autocompleteTanks.js';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
||||
import interactionToURL from '../core/discord/interactionToURL.js';
|
||||
import linkButton from '../core/discord/linkButton.js';
|
||||
import primaryButton from '../core/discord/primaryButton.js';
|
||||
import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton.js';
|
||||
import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand.js';
|
||||
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton.js';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import evolution from '../renderers/evolution.js';
|
||||
import { StatType } from '../renderers/fullStats.js';
|
||||
import { AccountInfo } from '../types/accountInfo.js';
|
||||
import { CYCLIC_API } from '../constants/cyclic';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import resolveTankId from '../core/blitz/resolveTankId';
|
||||
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups';
|
||||
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||
import interactionToURL from '../core/discord/interactionToURL';
|
||||
import linkButton from '../core/discord/linkButton';
|
||||
import primaryButton from '../core/discord/primaryButton';
|
||||
import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton';
|
||||
import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand';
|
||||
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import evolution from '../renderers/evolution';
|
||||
import { StatType } from '../renderers/fullStats';
|
||||
import { AccountInfo } from '../types/accountInfo';
|
||||
|
||||
export const evolutionCommand: CommandRegistry = {
|
||||
inProduction: true,
|
||||
|
||||
+17
-17
@@ -1,21 +1,21 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import { CYCLIC_API } from '../constants/cyclic.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import resolveTankId from '../core/blitz/resolveTankId.js';
|
||||
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups.js';
|
||||
import autocompleteTanks from '../core/discord/autocompleteTanks.js';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
||||
import interactionToURL from '../core/discord/interactionToURL.js';
|
||||
import linkButton from '../core/discord/linkButton.js';
|
||||
import primaryButton from '../core/discord/primaryButton.js';
|
||||
import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton.js';
|
||||
import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand.js';
|
||||
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton.js';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import fullStats, { StatType } from '../renderers/fullStats.js';
|
||||
import { AccountInfo } from '../types/accountInfo.js';
|
||||
import { CYCLIC_API } from '../constants/cyclic';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import resolveTankId from '../core/blitz/resolveTankId';
|
||||
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups';
|
||||
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||
import interactionToURL from '../core/discord/interactionToURL';
|
||||
import linkButton from '../core/discord/linkButton';
|
||||
import primaryButton from '../core/discord/primaryButton';
|
||||
import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton';
|
||||
import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand';
|
||||
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import fullStats, { StatType } from '../renderers/fullStats';
|
||||
import { AccountInfo } from '../types/accountInfo';
|
||||
|
||||
export const fullStatsCommand: CommandRegistry = {
|
||||
inProduction: true,
|
||||
|
||||
@@ -2,10 +2,7 @@ import {
|
||||
SlashCommandBuilder,
|
||||
SlashCommandSubcommandsOnlyBuilder,
|
||||
} from 'discord.js';
|
||||
import {
|
||||
COMMANDS_RAW,
|
||||
CommandRegistry,
|
||||
} from '../events/interactionCreate/index.js';
|
||||
import { COMMANDS_RAW, CommandRegistry } from '../events/interactionCreate';
|
||||
|
||||
const RAW_PATH = `https://raw.githubusercontent.com/tresabhi/blitzkrieg/main/docs/`;
|
||||
const DOCS = {
|
||||
|
||||
+14
-14
@@ -1,18 +1,18 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import GenericStats from '../components/GenericStats/index.js';
|
||||
import NoData, { NoDataType } from '../components/NoData.js';
|
||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy.js';
|
||||
import TitleBar from '../components/TitleBar.js';
|
||||
import Wrapper from '../components/Wrapper.js';
|
||||
import { BLITZ_SERVERS } from '../constants/servers.js';
|
||||
import getBlitzClan from '../core/blitz/getBlitzClan.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import addClanChoices from '../core/discord/addClanChoices.js';
|
||||
import autocompleteClan from '../core/discord/autocompleteClan.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import { AccountInfo } from '../types/accountInfo.js';
|
||||
import { ClanInfo } from '../types/clanInfo.js';
|
||||
import GenericStats from '../components/GenericStats';
|
||||
import NoData, { NoDataType } from '../components/NoData';
|
||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import Wrapper from '../components/Wrapper';
|
||||
import { BLITZ_SERVERS } from '../constants/servers';
|
||||
import getBlitzClan from '../core/blitz/getBlitzClan';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import addClanChoices from '../core/discord/addClanChoices';
|
||||
import autocompleteClan from '../core/discord/autocompleteClan';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import { AccountInfo } from '../types/accountInfo';
|
||||
import { ClanInfo } from '../types/clanInfo';
|
||||
|
||||
const DEFAULT_THRESHOLD = 7;
|
||||
|
||||
|
||||
+18
-18
@@ -1,26 +1,26 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import NoData, { NoDataType } from '../components/NoData.js';
|
||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy.js';
|
||||
import * as Tanks from '../components/Tanks/index.js';
|
||||
import TitleBar from '../components/TitleBar.js';
|
||||
import Wrapper from '../components/Wrapper.js';
|
||||
import { BLITZ_SERVERS } from '../constants/servers.js';
|
||||
import getTankStats from '../core/blitz/getTankStats.js';
|
||||
import getTreeType from '../core/blitz/getTreeType.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import resolveTankName from '../core/blitz/resolveTankName.js';
|
||||
import NoData, { NoDataType } from '../components/NoData';
|
||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy';
|
||||
import * as Tanks from '../components/Tanks';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import Wrapper from '../components/Wrapper';
|
||||
import { BLITZ_SERVERS } from '../constants/servers';
|
||||
import getTankStats from '../core/blitz/getTankStats';
|
||||
import getTreeType from '../core/blitz/getTreeType';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import resolveTankName from '../core/blitz/resolveTankName';
|
||||
import {
|
||||
TIER_ROMAN_NUMERALS,
|
||||
Tier,
|
||||
tankopedia,
|
||||
} from '../core/blitz/tankopedia.js';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import { AccountInfo } from '../types/accountInfo.js';
|
||||
import { PlayerClanData } from '../types/playerClanData.js';
|
||||
} from '../core/blitz/tankopedia';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import { AccountInfo } from '../types/accountInfo';
|
||||
import { PlayerClanData } from '../types/playerClanData';
|
||||
|
||||
const COMP_TANKS = [
|
||||
// light tanks
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
|
||||
export const pingCommand: CommandRegistry<true> = {
|
||||
inProduction: true,
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import { startCase } from 'lodash';
|
||||
import markdownEscape from 'markdown-escape';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
||||
import embedInfo from '../core/discord/embedInfo.js';
|
||||
import markdownTable, {
|
||||
TableInputEntry,
|
||||
} from '../core/discord/markdownTable.js';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import { AccountAchievements } from '../types/accountAchievements.js';
|
||||
import { AccountInfo } from '../types/accountInfo.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||
import embedInfo from '../core/discord/embedInfo';
|
||||
import markdownTable, { TableInputEntry } from '../core/discord/markdownTable';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import { AccountAchievements } from '../types/accountAchievements';
|
||||
import { AccountInfo } from '../types/accountInfo';
|
||||
|
||||
type SortBy = 'name' | 'count';
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import markdownEscape from 'markdown-escape';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
||||
import embedInfo from '../core/discord/embedInfo.js';
|
||||
import markdownTable from '../core/discord/markdownTable.js';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import { AccountInfo } from '../types/accountInfo.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||
import embedInfo from '../core/discord/embedInfo';
|
||||
import markdownTable from '../core/discord/markdownTable';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import { AccountInfo } from '../types/accountInfo';
|
||||
|
||||
export const playerInfoCommand: CommandRegistry = {
|
||||
inProduction: true,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import markdownEscape from 'markdown-escape';
|
||||
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import addClanChoices from '../core/discord/addClanChoices.js';
|
||||
import addServerChoices from '../core/discord/addServerChoices.js';
|
||||
import embedInfo from '../core/discord/embedInfo.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import { ClanList } from '../types/clanList.js';
|
||||
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import addClanChoices from '../core/discord/addClanChoices';
|
||||
import addServerChoices from '../core/discord/addServerChoices';
|
||||
import embedInfo from '../core/discord/embedInfo';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import { ClanList } from '../types/clanList';
|
||||
|
||||
export const searchClansCommand: CommandRegistry = {
|
||||
inProduction: true,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import markdownEscape from 'markdown-escape';
|
||||
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import { usernamePattern } from '../core/blitz/listPlayers.js';
|
||||
import addServerChoices from '../core/discord/addServerChoices.js';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
||||
import embedInfo from '../core/discord/embedInfo.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import { AccountList } from '../types/accountList.js';
|
||||
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import { usernamePattern } from '../core/blitz/listPlayers';
|
||||
import addServerChoices from '../core/discord/addServerChoices';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||
import embedInfo from '../core/discord/embedInfo';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import { AccountList } from '../types/accountList';
|
||||
|
||||
export const searchPlayersCommand: CommandRegistry = {
|
||||
inProduction: true,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import { go } from 'fuzzysort';
|
||||
import markdownEscape from 'markdown-escape';
|
||||
import { TANK_NAMES } from '../core/blitz/tankopedia.js';
|
||||
import addTankChoices from '../core/discord/addTankChoices.js';
|
||||
import embedInfo from '../core/discord/embedInfo.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import { TANK_NAMES } from '../core/blitz/tankopedia';
|
||||
import addTankChoices from '../core/discord/addTankChoices';
|
||||
import embedInfo from '../core/discord/embedInfo';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
|
||||
export const searchTanksCommand: CommandRegistry = {
|
||||
inProduction: true,
|
||||
|
||||
+18
-18
@@ -1,22 +1,22 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import { CYCLIC_API } from '../constants/cyclic.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import resolveTankId from '../core/blitz/resolveTankId.js';
|
||||
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups.js';
|
||||
import autocompleteTanks from '../core/discord/autocompleteTanks.js';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
||||
import interactionToURL from '../core/discord/interactionToURL.js';
|
||||
import linkButton from '../core/discord/linkButton.js';
|
||||
import primaryButton from '../core/discord/primaryButton.js';
|
||||
import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton.js';
|
||||
import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand.js';
|
||||
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton.js';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import { StatType } from '../renderers/fullStats.js';
|
||||
import stats from '../renderers/stats.js';
|
||||
import { AccountInfo } from '../types/accountInfo.js';
|
||||
import { CYCLIC_API } from '../constants/cyclic';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import resolveTankId from '../core/blitz/resolveTankId';
|
||||
import addStatTypeSubCommandGroups from '../core/discord/addStatTypeSubCommandGroups';
|
||||
import autocompleteTanks from '../core/discord/autocompleteTanks';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||
import interactionToURL from '../core/discord/interactionToURL';
|
||||
import linkButton from '../core/discord/linkButton';
|
||||
import primaryButton from '../core/discord/primaryButton';
|
||||
import resolvePeriodFromButton from '../core/discord/resolvePeriodFromButton';
|
||||
import resolvePeriodFromCommand from '../core/discord/resolvePeriodFromCommand';
|
||||
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import { StatType } from '../renderers/fullStats';
|
||||
import stats from '../renderers/stats';
|
||||
import { AccountInfo } from '../types/accountInfo';
|
||||
|
||||
export const statsCommand: CommandRegistry = {
|
||||
inProduction: true,
|
||||
|
||||
+13
-13
@@ -1,17 +1,17 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import { CYCLIC_API } from '../constants/cyclic.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
||||
import interactionToURL from '../core/discord/interactionToURL.js';
|
||||
import linkButton from '../core/discord/linkButton.js';
|
||||
import primaryButton from '../core/discord/primaryButton.js';
|
||||
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton.js';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import today from '../renderers/today.js';
|
||||
import { AccountInfo } from '../types/accountInfo.js';
|
||||
import { CYCLIC_API } from '../constants/cyclic';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||
import interactionToURL from '../core/discord/interactionToURL';
|
||||
import linkButton from '../core/discord/linkButton';
|
||||
import primaryButton from '../core/discord/primaryButton';
|
||||
import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import today from '../renderers/today';
|
||||
import { AccountInfo } from '../types/accountInfo';
|
||||
|
||||
export const todayCommand: CommandRegistry = {
|
||||
inProduction: true,
|
||||
|
||||
+10
-10
@@ -1,16 +1,16 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import markdownEscape from 'markdown-escape';
|
||||
import discord from '../../discord.json' assert { type: 'json' };
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername.js';
|
||||
import embedNegative from '../core/discord/embedNegative.js';
|
||||
import embedPositive from '../core/discord/embedPositive.js';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { CommandRegistry } from '../events/interactionCreate/index.js';
|
||||
import { AccountInfo } from '../types/accountInfo.js';
|
||||
import { PlayerClanData } from '../types/playerClanData.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||
import embedNegative from '../core/discord/embedNegative';
|
||||
import embedPositive from '../core/discord/embedPositive';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import { AccountInfo } from '../types/accountInfo';
|
||||
import { PlayerClanData } from '../types/playerClanData';
|
||||
|
||||
export const verifyCommand: CommandRegistry = {
|
||||
inProduction: true,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Percentile } from '../../../../../constants/percentiles.js';
|
||||
import hslToHex from '../../../../../core/node/hslToHex.js';
|
||||
import { PERCENTILE_COLORS } from '../../../../PercentileIndicator.js';
|
||||
import { Percentile } from '../../../../../constants/percentiles';
|
||||
import hslToHex from '../../../../../core/node/hslToHex';
|
||||
import { PERCENTILE_COLORS } from '../../../../PercentileIndicator';
|
||||
|
||||
export enum GlowSide {
|
||||
Top,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Percentile } from '../../../../constants/percentiles.js';
|
||||
import getWN8Percentile from '../../../../core/blitz/getWN8Percentile.js';
|
||||
import { theme } from '../../../../stitches.config.js';
|
||||
import { PERCENTILE_COLORS } from '../../../PercentileIndicator.js';
|
||||
import { Glow, GlowSide } from './components/Glow.js';
|
||||
import { Percentile } from '../../../../constants/percentiles';
|
||||
import getWN8Percentile from '../../../../core/blitz/getWN8Percentile';
|
||||
import { theme } from '../../../../stitches.config';
|
||||
import { PERCENTILE_COLORS } from '../../../PercentileIndicator';
|
||||
import { Glow, GlowSide } from './components/Glow';
|
||||
|
||||
export interface WN8DisplayProps {
|
||||
WN8?: number;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { theme } from '../../../stitches.config.js';
|
||||
import { theme } from '../../../stitches.config';
|
||||
|
||||
export enum WN8SurroundingStatAlign {
|
||||
Left,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { AllStats, SupplementaryStats } from '../../types/accountInfo.js';
|
||||
import { WN8Display } from './components/WN8Display/index.js';
|
||||
import { AllStats, SupplementaryStats } from '../../types/accountInfo';
|
||||
import { WN8Display } from './components/WN8Display';
|
||||
import {
|
||||
WN8SurroundingStat,
|
||||
WN8SurroundingStatAlign,
|
||||
} from './components/WN8SurroundingStat.js';
|
||||
} from './components/WN8SurroundingStat';
|
||||
|
||||
export interface AllStatsOverviewProps {
|
||||
stats: AllStats;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import getWN8Percentile from '../../../core/blitz/getWN8Percentile.js';
|
||||
import { theme } from '../../../stitches.config.js';
|
||||
import { RowDiscriminator } from './RowDiscriminator.js';
|
||||
import { RowStat } from './RowStat.js';
|
||||
import getWN8Percentile from '../../../core/blitz/getWN8Percentile';
|
||||
import { theme } from '../../../stitches.config';
|
||||
import { RowDiscriminator } from './RowDiscriminator';
|
||||
import { RowStat } from './RowStat';
|
||||
|
||||
export interface RowProps {
|
||||
name: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { theme } from '../../../stitches.config.js';
|
||||
import { theme } from '../../../stitches.config';
|
||||
|
||||
export interface RowDiscriminatorProps {
|
||||
name: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Percentile } from '../../../constants/percentiles.js';
|
||||
import { theme } from '../../../stitches.config.js';
|
||||
import PercentileIndicator from '../../PercentileIndicator.js';
|
||||
import { Percentile } from '../../../constants/percentiles';
|
||||
import { theme } from '../../../stitches.config';
|
||||
import PercentileIndicator from '../../PercentileIndicator';
|
||||
|
||||
export interface RowStatProps {
|
||||
name: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export * from './components/Root.js';
|
||||
export * from './components/Row.js';
|
||||
export * from './components/RowDiscriminator.js';
|
||||
export * from './components/RowStat.js';
|
||||
export * from './components/Root';
|
||||
export * from './components/Row';
|
||||
export * from './components/RowDiscriminator';
|
||||
export * from './components/RowStat';
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Percentile } from '../../../constants/percentiles.js';
|
||||
import { theme } from '../../../stitches.config.js';
|
||||
import PercentileIndicator from '../../PercentileIndicator.js';
|
||||
import { Percentile } from '../../../constants/percentiles';
|
||||
import { theme } from '../../../stitches.config';
|
||||
import PercentileIndicator from '../../PercentileIndicator';
|
||||
|
||||
export interface CardItem {
|
||||
label: string;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import getWN8Percentile from '../../core/blitz/getWN8Percentile.js';
|
||||
import isNumber from '../../core/node/isNumber.js';
|
||||
import { AllStats, SupplementaryStats } from '../../types/accountInfo.js';
|
||||
import { Card } from './components/Card.js';
|
||||
import { Root } from './components/Root.js';
|
||||
import { Row } from './components/Row.js';
|
||||
import getWN8Percentile from '../../core/blitz/getWN8Percentile';
|
||||
import isNumber from '../../core/node/isNumber';
|
||||
import { AllStats, SupplementaryStats } from '../../types/accountInfo';
|
||||
import { Card } from './components/Card';
|
||||
import { Root } from './components/Root';
|
||||
import { Row } from './components/Row';
|
||||
|
||||
// TODO: remove the .js endings
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Stat } from '../index.js';
|
||||
import GenericStatsRow from './GenericStatsRow.js';
|
||||
import { Stat } from '..';
|
||||
import GenericStatsRow from './GenericStatsRow';
|
||||
|
||||
export interface GenericStatsColumnProps {
|
||||
stats: Stat[];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { theme } from '../../../stitches.config.js';
|
||||
import PercentileIndicator from '../../PercentileIndicator.js';
|
||||
import { Stat } from '../index.js';
|
||||
import { Stat } from '..';
|
||||
import { theme } from '../../../stitches.config';
|
||||
import PercentileIndicator from '../../PercentileIndicator';
|
||||
|
||||
export interface GenericStatsRowProps {
|
||||
stat: Stat;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Percentile } from '../../constants/percentiles.js';
|
||||
import GenericStatsColumn from './components/GenericStatsColumn.js';
|
||||
import { Percentile } from '../../constants/percentiles';
|
||||
import GenericStatsColumn from './components/GenericStatsColumn';
|
||||
|
||||
export type Stat =
|
||||
| [string, string | number | undefined]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 {
|
||||
Red,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { times } from 'lodash';
|
||||
import { theme } from '../../../stitches.config.js';
|
||||
import { MarginInputProps } from './Root.js';
|
||||
import { theme } from '../../../stitches.config';
|
||||
import { MarginInputProps } from './Root';
|
||||
|
||||
export enum MarginOrientation {
|
||||
Vertical,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { times } from 'lodash';
|
||||
import { ReactNode } from 'react';
|
||||
import { theme } from '../../../stitches.config.js';
|
||||
import { Margin, MarginOrientation } from './Margin.js';
|
||||
import { theme } from '../../../stitches.config';
|
||||
import { Margin, MarginOrientation } from './Margin';
|
||||
|
||||
export const GRAPH_WIDTH = 544;
|
||||
export const GRAPH_HEIGHT = 320;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export * from './components/Line.js';
|
||||
export * from './components/Margin.js';
|
||||
export * from './components/Root.js';
|
||||
export * from './components/Line';
|
||||
export * from './components/Margin';
|
||||
export * from './components/Root';
|
||||
@@ -1,4 +1,4 @@
|
||||
import { theme } from '../stitches.config.js';
|
||||
import { theme } from '../stitches.config';
|
||||
|
||||
export enum NoDataType {
|
||||
BattlesInPeriod,
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
teal,
|
||||
yellow,
|
||||
} from '@radix-ui/colors';
|
||||
import { Percentile } from '../constants/percentiles.js';
|
||||
import { Percentile } from '../constants/percentiles';
|
||||
|
||||
export interface PercentileIndicatorProps {
|
||||
percentile: Percentile;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { theme } from '../stitches.config.js';
|
||||
import { theme } from '../stitches.config';
|
||||
|
||||
export enum PoweredByType {
|
||||
BlitzStars,
|
||||
|
||||
@@ -2,8 +2,8 @@ import {
|
||||
TANK_ICONS,
|
||||
TANK_ICONS_COLLECTOR,
|
||||
TANK_ICONS_PREMIUM,
|
||||
} from '../../../core/blitz/tankopedia.js';
|
||||
import { theme } from '../../../stitches.config.js';
|
||||
} from '../../../core/blitz/tankopedia';
|
||||
import { theme } from '../../../stitches.config';
|
||||
|
||||
export enum TreeType {
|
||||
TechTree,
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export * from './components/Column.js';
|
||||
export * from './components/Item.js';
|
||||
export * from './components/Root.js';
|
||||
export * from './components/Column';
|
||||
export * from './components/Item';
|
||||
export * from './components/Root';
|
||||
@@ -1,5 +1,5 @@
|
||||
import { TIER_ROMAN_NUMERALS, Tier } from '../core/blitz/tankopedia.js';
|
||||
import { theme } from '../stitches.config.js';
|
||||
import { TIER_ROMAN_NUMERALS, Tier } from '../core/blitz/tankopedia';
|
||||
import { theme } from '../stitches.config';
|
||||
|
||||
export type TierWeightsRecord = Partial<Record<Tier, number>>;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import isDev from '../core/node/isDev.js';
|
||||
import { theme } from '../stitches.config.js';
|
||||
import isDev from '../core/node/isDev';
|
||||
import { theme } from '../stitches.config';
|
||||
|
||||
export interface TitleBarProps {
|
||||
name: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { theme } from '../stitches.config.js';
|
||||
import { theme } from '../stitches.config';
|
||||
|
||||
export interface WrapperProps {
|
||||
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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AllStats } from '../../types/accountInfo.js';
|
||||
import { AllStats } from '../../types/accountInfo';
|
||||
|
||||
export default function diffStats(stats1: AllStats, stats2: AllStats) {
|
||||
function diff(value: (allStats: AllStats) => number) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { serverAndIdPattern } from '../discord/resolvePlayerFromCommand.js';
|
||||
import throwError from '../node/throwError.js';
|
||||
import listClans from './listClans.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import { serverAndIdPattern } from '../discord/resolvePlayerFromCommand';
|
||||
import throwError from '../node/throwError';
|
||||
import listClans from './listClans';
|
||||
|
||||
export default async function getBlitzClan(clan: string) {
|
||||
if (serverAndIdPattern.test(clan)) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { BLITZ_SERVERS, BlitzServer } from '../../constants/servers.js';
|
||||
import { TanksStats } from '../../types/tanksStats.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments.js';
|
||||
import throwError from '../node/throwError.js';
|
||||
import getWargamingResponse from './getWargamingResponse.js';
|
||||
import { BLITZ_SERVERS, BlitzServer } from '../../constants/servers';
|
||||
import { TanksStats } from '../../types/tanksStats';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments';
|
||||
import throwError from '../node/throwError';
|
||||
import getWargamingResponse from './getWargamingResponse';
|
||||
|
||||
export default async function getTankStats(server: BlitzServer, id: number) {
|
||||
const tankStats = await getWargamingResponse<TanksStats>(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { TreeType } from '../../components/Tanks/index.js';
|
||||
import { tankopedia } from './tankopedia.js';
|
||||
import { TreeType } from '../../components/Tanks';
|
||||
import { tankopedia } from './tankopedia';
|
||||
|
||||
export default async function getTreeType(id: number) {
|
||||
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][] = [
|
||||
[0, Percentile.VeryBad],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import throwError from '../node/throwError.js';
|
||||
import throwError from '../node/throwError';
|
||||
|
||||
export type WargamingResponse<Data extends object> =
|
||||
| {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { Clan, ClanList } from '../../types/clanList.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments.js';
|
||||
import getWargamingResponse from './getWargamingResponse.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import { Clan, ClanList } from '../../types/clanList';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments';
|
||||
import getWargamingResponse from './getWargamingResponse';
|
||||
|
||||
export type ClanListWithServer = (Clan & {
|
||||
server: 'com' | 'eu' | 'asia';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { Account, AccountList } from '../../types/accountList.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments.js';
|
||||
import getWargamingResponse from './getWargamingResponse.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import { Account, AccountList } from '../../types/accountList';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments';
|
||||
import getWargamingResponse from './getWargamingResponse';
|
||||
|
||||
export type AccountListWithServer = (Account & {
|
||||
server: 'com' | 'eu' | 'asia';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { go } from 'fuzzysort';
|
||||
import throwError from '../node/throwError.js';
|
||||
import { TANKS, tankopedia } from './tankopedia.js';
|
||||
import throwError from '../node/throwError';
|
||||
import { TANKS, tankopedia } from './tankopedia';
|
||||
|
||||
export default async function resolveTankId(tank: string) {
|
||||
const number = parseInt(tank);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { tankopedia } from './tankopedia.js';
|
||||
import { tankopedia } from './tankopedia';
|
||||
|
||||
export default async function resolveTankName(tankId: number) {
|
||||
const tankopediaName = (await tankopedia)[tankId]?.name;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AllStats } from '../../types/accountInfo.js';
|
||||
import { emptyAllStats } from '../blitzstars/getDiffedTankStats.js';
|
||||
import { AllStats } from '../../types/accountInfo';
|
||||
import { emptyAllStats } from '../blitzstars/getDiffedTankStats';
|
||||
|
||||
export default function sumStats(allStatsCollection: AllStats[]) {
|
||||
return allStatsCollection.reduce((accumulated, current) => {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { AllStats } from '../../types/accountInfo.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import { AllStats } from '../../types/accountInfo';
|
||||
import getTankHistories, {
|
||||
TankHistories,
|
||||
TankHistoryRaw,
|
||||
} from './getTankHistories.js';
|
||||
} from './getTankHistories';
|
||||
|
||||
export const emptyAllStats: AllStats = {
|
||||
battles: 0,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { Period } from '../discord/addPeriodSubCommands.js';
|
||||
import getTimeDaysAgo from './getTimeDaysAgo.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import { Period } from '../discord/addPeriodSubCommands';
|
||||
import getTimeDaysAgo from './getTimeDaysAgo';
|
||||
|
||||
export default function getPeriodStart(
|
||||
server: BlitzServer,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { AccountInfo, AllStats } from '../../types/accountInfo.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import { AccountInfo, AllStats } from '../../types/accountInfo';
|
||||
import {
|
||||
GetHistoriesOptions,
|
||||
Histories,
|
||||
History,
|
||||
getHistoriesDefaultOptions,
|
||||
} from '../../types/histories.js';
|
||||
import getWargamingResponse from '../blitz/getWargamingResponse.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments.js';
|
||||
import { emptyAllStats } from './getDiffedTankStats.js';
|
||||
} from '../../types/histories';
|
||||
import getWargamingResponse from '../blitz/getWargamingResponse';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments';
|
||||
import { emptyAllStats } from './getDiffedTankStats';
|
||||
|
||||
export interface PlayerHistoryRaw {
|
||||
clan: { clan_id: number; name: string; tag: string };
|
||||
@@ -44,7 +44,7 @@ export default async function getPlayerHistories(
|
||||
({
|
||||
all: history.statistics.all,
|
||||
last_battle_time: history.last_battle_time,
|
||||
} satisfies History),
|
||||
}) satisfies History,
|
||||
);
|
||||
let lastNonCompliantIndex = -1;
|
||||
let hasCompliedOnce = false;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import {
|
||||
GetHistoriesOptions,
|
||||
Histories,
|
||||
History,
|
||||
getHistoriesDefaultOptions,
|
||||
} from '../../types/histories.js';
|
||||
import getTankStats from '../blitz/getTankStats.js';
|
||||
import { emptyAllStats } from './getDiffedTankStats.js';
|
||||
} from '../../types/histories';
|
||||
import getTankStats from '../blitz/getTankStats';
|
||||
import { emptyAllStats } from './getDiffedTankStats';
|
||||
|
||||
export interface TankHistory extends History {
|
||||
tank_id: number;
|
||||
@@ -48,7 +48,7 @@ export default async function getTankHistories(
|
||||
all: history.all,
|
||||
last_battle_time: history.last_battle_time,
|
||||
tank_id: history.tank_id,
|
||||
} satisfies TankHistory),
|
||||
}) satisfies TankHistory,
|
||||
);
|
||||
const compliantTanks: 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> = {
|
||||
com: -5, // Central North American Time
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sumStats from '../blitz/sumStats.js';
|
||||
import { emptyAllStats } from './getDiffedTankStats.js';
|
||||
import { tankAverages } from './tankAverages.js';
|
||||
import sumStats from '../blitz/sumStats';
|
||||
import { emptyAllStats } from './getDiffedTankStats';
|
||||
import { tankAverages } from './tankAverages';
|
||||
|
||||
console.log('Calculating player average...');
|
||||
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 {
|
||||
winrate: number;
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
SlashCommandSubcommandBuilder,
|
||||
SlashCommandSubcommandGroupBuilder,
|
||||
} 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';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SlashCommandStringOption } from 'discord.js';
|
||||
import { BLITZ_SERVERS } from '../../constants/servers.js';
|
||||
import { BLITZ_SERVERS } from '../../constants/servers';
|
||||
|
||||
export default function addServerChoices(option: SlashCommandStringOption) {
|
||||
return option
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import addPeriodSubCommands from './addPeriodSubCommands.js';
|
||||
import addTankChoices from './addTankChoices.js';
|
||||
import addUsernameChoices from './addUsernameChoices.js';
|
||||
import addPeriodSubCommands from './addPeriodSubCommands';
|
||||
import addTankChoices from './addTankChoices';
|
||||
import addUsernameChoices from './addUsernameChoices';
|
||||
|
||||
export default function addStatTypeSubCommandGroups(
|
||||
option: SlashCommandBuilder,
|
||||
|
||||
@@ -3,8 +3,8 @@ import {
|
||||
AutocompleteInteraction,
|
||||
CacheType,
|
||||
} from 'discord.js';
|
||||
import { BLITZ_SERVERS } from '../../constants/servers.js';
|
||||
import listClans from '../blitz/listClans.js';
|
||||
import { BLITZ_SERVERS } from '../../constants/servers';
|
||||
import listClans from '../blitz/listClans';
|
||||
|
||||
export default async function autocompleteClan(
|
||||
interaction: AutocompleteInteraction<CacheType>,
|
||||
@@ -20,7 +20,7 @@ export default async function autocompleteClan(
|
||||
({
|
||||
name: `${player.name} (${BLITZ_SERVERS[player.server]})`,
|
||||
value: `${player.server}/${player.clan_id}`,
|
||||
} satisfies ApplicationCommandOptionChoiceData<string>),
|
||||
}) satisfies ApplicationCommandOptionChoiceData<string>,
|
||||
)
|
||||
: [],
|
||||
);
|
||||
|
||||
@@ -4,8 +4,8 @@ import {
|
||||
CacheType,
|
||||
} from 'discord.js';
|
||||
import { go } from 'fuzzysort';
|
||||
import resolveTankName from '../blitz/resolveTankName.js';
|
||||
import { TANKS } from '../blitz/tankopedia.js';
|
||||
import resolveTankName from '../blitz/resolveTankName';
|
||||
import { TANKS } from '../blitz/tankopedia';
|
||||
|
||||
export default async function autocompleteTanks(
|
||||
interaction: AutocompleteInteraction<CacheType>,
|
||||
@@ -16,14 +16,17 @@ export default async function autocompleteTanks(
|
||||
await interaction.respond(
|
||||
focusedOption.value
|
||||
? 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) =>
|
||||
({
|
||||
name: item.obj.name
|
||||
? item.obj.name
|
||||
: await resolveTankName(item.obj.tank_id),
|
||||
value: `${item.obj.tank_id}`,
|
||||
} satisfies ApplicationCommandOptionChoiceData<string>),
|
||||
}) satisfies ApplicationCommandOptionChoiceData<string>,
|
||||
),
|
||||
)
|
||||
: [],
|
||||
|
||||
@@ -3,8 +3,8 @@ import {
|
||||
AutocompleteInteraction,
|
||||
CacheType,
|
||||
} from 'discord.js';
|
||||
import { BLITZ_SERVERS } from '../../constants/servers.js';
|
||||
import listPlayers from '../blitz/listPlayers.js';
|
||||
import { BLITZ_SERVERS } from '../../constants/servers';
|
||||
import listPlayers from '../blitz/listPlayers';
|
||||
|
||||
export default async function autocompleteUsername(
|
||||
interaction: AutocompleteInteraction<CacheType>,
|
||||
@@ -21,7 +21,7 @@ export default async function autocompleteUsername(
|
||||
({
|
||||
name: `${player.nickname} (${BLITZ_SERVERS[player.server]})`,
|
||||
value: `${player.server}/${player.account_id}`,
|
||||
} satisfies ApplicationCommandOptionChoiceData<string>),
|
||||
}) satisfies ApplicationCommandOptionChoiceData<string>,
|
||||
)
|
||||
: [],
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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) {
|
||||
const embed = new EmbedBuilder()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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) {
|
||||
return new EmbedBuilder()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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) {
|
||||
return new EmbedBuilder()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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) {
|
||||
return new EmbedBuilder()
|
||||
|
||||
@@ -4,8 +4,8 @@ import {
|
||||
EmbedBuilder,
|
||||
InteractionEditReplyOptions,
|
||||
} from 'discord.js';
|
||||
import { InteractionReturnable } from '../../events/interactionCreate/index.js';
|
||||
import jsxToPng from '../node/jsxToPng.js';
|
||||
import { InteractionReturnable } from '../../events/interactionCreate';
|
||||
import jsxToPng from '../node/jsxToPng';
|
||||
|
||||
export default async function normalizeInteractionReturnable(
|
||||
returnable: InteractionReturnable,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ButtonInteraction, CacheType } from 'discord.js';
|
||||
import { CYCLIC_API } from '../../constants/cyclic.js';
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import resolvePeriodFromURL from '../express/resolvePeriodFromURL.js';
|
||||
import { CYCLIC_API } from '../../constants/cyclic';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import resolvePeriodFromURL from '../express/resolvePeriodFromURL';
|
||||
|
||||
export default function resolvePeriodFromButton(
|
||||
server: BlitzServer,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import getPeriodNow from '../blitzstars/getPeriodNow.js';
|
||||
import getPeriodStart from '../blitzstars/getPeriodStart.js';
|
||||
import getTimeDaysAgo from '../blitzstars/getTimeDaysAgo.js';
|
||||
import { Period } from '../discord/addPeriodSubCommands.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import getPeriodNow from '../blitzstars/getPeriodNow';
|
||||
import getPeriodStart from '../blitzstars/getPeriodStart';
|
||||
import getTimeDaysAgo from '../blitzstars/getTimeDaysAgo';
|
||||
import { Period } from '../discord/addPeriodSubCommands';
|
||||
|
||||
export const PERIOD_NAMES: Record<Period, string> = {
|
||||
today: "Today's statistics",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ButtonInteraction, CacheType } from 'discord.js';
|
||||
import { CYCLIC_API } from '../../constants/cyclic.js';
|
||||
import resolvePlayerFromURL from '../express/resolvePlayerFromURL.js';
|
||||
import { CYCLIC_API } from '../../constants/cyclic';
|
||||
import resolvePlayerFromURL from '../express/resolvePlayerFromURL';
|
||||
|
||||
export default async function resolvePlayerFromButton(
|
||||
interaction: ButtonInteraction<CacheType>,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import listPlayers, {
|
||||
usernamePatternWithoutPosition,
|
||||
} from '../blitz/listPlayers.js';
|
||||
import throwError from '../node/throwError.js';
|
||||
} from '../blitz/listPlayers';
|
||||
import throwError from '../node/throwError';
|
||||
|
||||
export const serverAndIdPattern = /(com|eu|asia)\/[0-9]+/;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RouteReturnable } from '../../server.js';
|
||||
import jsxToSvg from '../node/jsxToSvg.js';
|
||||
import { RouteReturnable } from '../../server';
|
||||
import jsxToSvg from '../node/jsxToSvg';
|
||||
|
||||
export default async function normalizeRouteReturnable(
|
||||
returnable: RouteReturnable,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Request } from 'express';
|
||||
import { CYCLIC_API } from '../../constants/cyclic.js';
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import resolvePeriodFromURL from './resolvePeriodFromURL.js';
|
||||
import { CYCLIC_API } from '../../constants/cyclic';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import resolvePeriodFromURL from './resolvePeriodFromURL';
|
||||
|
||||
export default function resolvePeriodFromRequest(
|
||||
server: BlitzServer,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import getPeriodNow from '../blitzstars/getPeriodNow.js';
|
||||
import getPeriodStart from '../blitzstars/getPeriodStart.js';
|
||||
import getTimeDaysAgo from '../blitzstars/getTimeDaysAgo.js';
|
||||
import { Period } from '../discord/addPeriodSubCommands.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import getPeriodNow from '../blitzstars/getPeriodNow';
|
||||
import getPeriodStart from '../blitzstars/getPeriodStart';
|
||||
import getTimeDaysAgo from '../blitzstars/getTimeDaysAgo';
|
||||
import { Period } from '../discord/addPeriodSubCommands';
|
||||
import {
|
||||
EVOLUTION_PERIOD_NAMES,
|
||||
PERIOD_NAMES,
|
||||
ResolvedPeriod,
|
||||
} from '../discord/resolvePeriodFromCommand.js';
|
||||
} from '../discord/resolvePeriodFromCommand';
|
||||
|
||||
export default function resolvePeriodFromURL(
|
||||
server: BlitzServer,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Request } from 'express';
|
||||
import { CYCLIC_API } from '../../constants/cyclic.js';
|
||||
import resolvePlayerFromURL from './resolvePlayerFromURL.js';
|
||||
import { CYCLIC_API } from '../../constants/cyclic';
|
||||
import resolvePlayerFromURL from './resolvePlayerFromURL';
|
||||
|
||||
export default function resolvePlayerFromRequest(request: Request) {
|
||||
return resolvePlayerFromURL(`${CYCLIC_API}${request.originalUrl}`);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import { ResolvedPlayer } from '../discord/resolvePlayerFromCommand.js';
|
||||
import { BlitzServer } from '../../constants/servers';
|
||||
import { ResolvedPlayer } from '../discord/resolvePlayerFromCommand';
|
||||
|
||||
export default function resolvePlayerFromURL(urlString: string) {
|
||||
const url = new URL(urlString);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import discord from '../../../discord.json' assert { type: 'json' };
|
||||
import isDev from './isDev.js';
|
||||
import isDev from './isDev';
|
||||
|
||||
export default function getClientId() {
|
||||
return isDev() ? discord.client_id_dev : discord.client_id;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import jsxToSvg from './jsxToSvg.js';
|
||||
import svgToPng from './svgToPng.js';
|
||||
import jsxToSvg from './jsxToSvg';
|
||||
import svgToPng from './svgToPng';
|
||||
|
||||
export default async function jsxToPng(jsx: JSX.Element) {
|
||||
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) {
|
||||
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 discord from '../../discord.json' assert { type: 'json' };
|
||||
import { client } from '../bot.js';
|
||||
import { NEGATIVE_COLOR } from '../constants/colors.js';
|
||||
import isDev from '../core/node/isDev.js';
|
||||
import { client } from '../bot';
|
||||
import { NEGATIVE_COLOR } from '../constants/colors';
|
||||
import isDev from '../core/node/isDev';
|
||||
|
||||
const PROCESS_ERROR_EVENTS = ['uncaughtException'];
|
||||
const CLIENT_ERROR_EVENTS = ['error'];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EmbedBuilder, GuildMember, TextChannel } from 'discord.js';
|
||||
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) {
|
||||
if (member.guild.id === discord.sklld_guild_id) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AutocompleteInteraction, CacheType } from 'discord.js';
|
||||
import { commands } from '../index.js';
|
||||
import { commands } from '..';
|
||||
|
||||
export default function handleAutocomplete(
|
||||
interaction: AutocompleteInteraction<CacheType>,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ButtonInteraction, CacheType } from 'discord.js';
|
||||
import { CYCLIC_API } from '../../../constants/cyclic.js';
|
||||
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable.js';
|
||||
import throwError from '../../../core/node/throwError.js';
|
||||
import { commands } from '../index.js';
|
||||
import { commands } from '..';
|
||||
import { CYCLIC_API } from '../../../constants/cyclic';
|
||||
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable';
|
||||
import throwError from '../../../core/node/throwError';
|
||||
|
||||
export default async function handleButton(
|
||||
interaction: ButtonInteraction<CacheType>,
|
||||
|
||||
@@ -5,12 +5,12 @@ import {
|
||||
CacheType,
|
||||
ChatInputCommandInteraction,
|
||||
} from 'discord.js';
|
||||
import embedNegative from '../../../core/discord/embedNegative.js';
|
||||
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable.js';
|
||||
import embedWarning from '../../../core/discord/embedWarning.js';
|
||||
import { psa } from '../../../core/discord/psa.js';
|
||||
import { handleError } from '../../error.js';
|
||||
import { commands } from '../index.js';
|
||||
import { commands } from '..';
|
||||
import embedNegative from '../../../core/discord/embedNegative';
|
||||
import embedWarning from '../../../core/discord/embedWarning';
|
||||
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable';
|
||||
import { psa } from '../../../core/discord/psa';
|
||||
import { handleError } from '../../error';
|
||||
|
||||
export default async function handleChatInputCommand(
|
||||
interaction: ChatInputCommandInteraction<CacheType>,
|
||||
|
||||
@@ -13,28 +13,28 @@ import {
|
||||
SlashCommandSubcommandsOnlyBuilder,
|
||||
} from 'discord.js';
|
||||
import discord from '../../../discord.json' assert { type: 'json' };
|
||||
import { debugCommand } from '../../commands/debug.js';
|
||||
import { eligibleCommand } from '../../commands/eligible.js';
|
||||
import { evolutionCommand } from '../../commands/evolution.js';
|
||||
import { fullStatsCommand } from '../../commands/fullStats.js';
|
||||
import { helpCommand } from '../../commands/help.js';
|
||||
import { inactiveCommand } from '../../commands/inactive.js';
|
||||
import { ownedTanksCommand } from '../../commands/ownedTanks.js';
|
||||
import { pingCommand } from '../../commands/ping.js';
|
||||
import { playerAchievementsCommand } from '../../commands/playerAchievements.js';
|
||||
import { playerInfoCommand } from '../../commands/playerInfo.js';
|
||||
import { searchClansCommand } from '../../commands/searchClans.js';
|
||||
import { searchPlayersCommand } from '../../commands/searchPlayers.js';
|
||||
import { searchTanksCommand } from '../../commands/searchTanks.js';
|
||||
import { statsCommand } from '../../commands/stats.js';
|
||||
import { todayCommand } from '../../commands/today.js';
|
||||
import { verifyCommand } from '../../commands/verify.js';
|
||||
import { DISCORD_TOKEN } from '../../core/node/arguments.js';
|
||||
import getClientId from '../../core/node/getClientId.js';
|
||||
import isDev from '../../core/node/isDev.js';
|
||||
import handleAutocomplete from './handlers/autocomplete.js';
|
||||
import handleButton from './handlers/button.js';
|
||||
import handleChatInputCommand from './handlers/chatInputCommand.js';
|
||||
import { debugCommand } from '../../commands/debug';
|
||||
import { eligibleCommand } from '../../commands/eligible';
|
||||
import { evolutionCommand } from '../../commands/evolution';
|
||||
import { fullStatsCommand } from '../../commands/fullStats';
|
||||
import { helpCommand } from '../../commands/help';
|
||||
import { inactiveCommand } from '../../commands/inactive';
|
||||
import { ownedTanksCommand } from '../../commands/ownedTanks';
|
||||
import { pingCommand } from '../../commands/ping';
|
||||
import { playerAchievementsCommand } from '../../commands/playerAchievements';
|
||||
import { playerInfoCommand } from '../../commands/playerInfo';
|
||||
import { searchClansCommand } from '../../commands/searchClans';
|
||||
import { searchPlayersCommand } from '../../commands/searchPlayers';
|
||||
import { searchTanksCommand } from '../../commands/searchTanks';
|
||||
import { statsCommand } from '../../commands/stats';
|
||||
import { todayCommand } from '../../commands/today';
|
||||
import { verifyCommand } from '../../commands/verify';
|
||||
import { DISCORD_TOKEN } from '../../core/node/arguments';
|
||||
import getClientId from '../../core/node/getClientId';
|
||||
import isDev from '../../core/node/isDev';
|
||||
import handleAutocomplete from './handlers/autocomplete';
|
||||
import handleButton from './handlers/button';
|
||||
import handleChatInputCommand from './handlers/chatInputCommand';
|
||||
|
||||
export type InteractionRawReturnable =
|
||||
| string
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
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>) {
|
||||
console.log(
|
||||
|
||||
+18
-18
@@ -1,21 +1,21 @@
|
||||
import * as Graph from '../components/Graph/index.js';
|
||||
import NoData, { NoDataType } from '../components/NoData.js';
|
||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy.js';
|
||||
import TitleBar from '../components/TitleBar.js';
|
||||
import Wrapper from '../components/Wrapper.js';
|
||||
import { BLITZ_SERVERS } from '../constants/servers.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import resolveTankName from '../core/blitz/resolveTankName.js';
|
||||
import { tankopedia } from '../core/blitz/tankopedia.js';
|
||||
import getPlayerHistories from '../core/blitzstars/getPlayerHistories.js';
|
||||
import getTankHistories from '../core/blitzstars/getTankHistories.js';
|
||||
import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand.js';
|
||||
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { AccountInfo } from '../types/accountInfo.js';
|
||||
import { Histories } from '../types/histories.js';
|
||||
import { PlayerClanData } from '../types/playerClanData.js';
|
||||
import { StatType } from './fullStats.js';
|
||||
import * as Graph from '../components/Graph';
|
||||
import NoData, { NoDataType } from '../components/NoData';
|
||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import Wrapper from '../components/Wrapper';
|
||||
import { BLITZ_SERVERS } from '../constants/servers';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import resolveTankName from '../core/blitz/resolveTankName';
|
||||
import { tankopedia } from '../core/blitz/tankopedia';
|
||||
import getPlayerHistories from '../core/blitzstars/getPlayerHistories';
|
||||
import getTankHistories from '../core/blitzstars/getTankHistories';
|
||||
import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand';
|
||||
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { AccountInfo } from '../types/accountInfo';
|
||||
import { Histories } from '../types/histories';
|
||||
import { PlayerClanData } from '../types/playerClanData';
|
||||
import { StatType } from './fullStats';
|
||||
|
||||
export default async function evolution<Type extends StatType>(
|
||||
type: Type,
|
||||
|
||||
+20
-20
@@ -1,27 +1,27 @@
|
||||
import GenericAllStats from '../components/GenericAllStats/index.js';
|
||||
import NoData, { NoDataType } from '../components/NoData.js';
|
||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy.js';
|
||||
import TierWeights, { TierWeightsRecord } from '../components/TierWeights.js';
|
||||
import TitleBar from '../components/TitleBar.js';
|
||||
import Wrapper from '../components/Wrapper.js';
|
||||
import { BLITZ_SERVERS } from '../constants/servers.js';
|
||||
import calculateWN8 from '../core/blitz/calculateWN8.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import resolveTankName from '../core/blitz/resolveTankName.js';
|
||||
import sumStats from '../core/blitz/sumStats.js';
|
||||
import { Tier, tankopedia } from '../core/blitz/tankopedia.js';
|
||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats.js';
|
||||
import { tankAverages } from '../core/blitzstars/tankAverages.js';
|
||||
import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand.js';
|
||||
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import GenericAllStats from '../components/GenericAllStats';
|
||||
import NoData, { NoDataType } from '../components/NoData';
|
||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy';
|
||||
import TierWeights, { TierWeightsRecord } from '../components/TierWeights';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import Wrapper from '../components/Wrapper';
|
||||
import { BLITZ_SERVERS } from '../constants/servers';
|
||||
import calculateWN8 from '../core/blitz/calculateWN8';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import resolveTankName from '../core/blitz/resolveTankName';
|
||||
import sumStats from '../core/blitz/sumStats';
|
||||
import { Tier, tankopedia } from '../core/blitz/tankopedia';
|
||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats';
|
||||
import { tankAverages } from '../core/blitzstars/tankAverages';
|
||||
import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand';
|
||||
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import {
|
||||
AccountInfo,
|
||||
AllStats,
|
||||
SupplementaryStats,
|
||||
} from '../types/accountInfo.js';
|
||||
import { PlayerClanData } from '../types/playerClanData.js';
|
||||
import { PossiblyPromise } from '../types/possiblyPromise.js';
|
||||
} from '../types/accountInfo';
|
||||
import { PlayerClanData } from '../types/playerClanData';
|
||||
import { PossiblyPromise } from '../types/possiblyPromise';
|
||||
|
||||
export type StatType = 'player' | 'tank';
|
||||
|
||||
|
||||
+21
-21
@@ -1,28 +1,28 @@
|
||||
import AllStatsOverview from '../components/AllStatsOverview/index.js';
|
||||
import NoData, { NoDataType } from '../components/NoData.js';
|
||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy.js';
|
||||
import { TierWeightsRecord } from '../components/TierWeights.js';
|
||||
import TitleBar from '../components/TitleBar.js';
|
||||
import Wrapper from '../components/Wrapper.js';
|
||||
import { BLITZ_SERVERS } from '../constants/servers.js';
|
||||
import calculateWN8 from '../core/blitz/calculateWN8.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import resolveTankName from '../core/blitz/resolveTankName.js';
|
||||
import sumStats from '../core/blitz/sumStats.js';
|
||||
import { Tier, tankopedia } from '../core/blitz/tankopedia.js';
|
||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats.js';
|
||||
import { tankAverages } from '../core/blitzstars/tankAverages.js';
|
||||
import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand.js';
|
||||
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { theme } from '../stitches.config.js';
|
||||
import AllStatsOverview from '../components/AllStatsOverview';
|
||||
import NoData, { NoDataType } from '../components/NoData';
|
||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy';
|
||||
import { TierWeightsRecord } from '../components/TierWeights';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import Wrapper from '../components/Wrapper';
|
||||
import { BLITZ_SERVERS } from '../constants/servers';
|
||||
import calculateWN8 from '../core/blitz/calculateWN8';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import resolveTankName from '../core/blitz/resolveTankName';
|
||||
import sumStats from '../core/blitz/sumStats';
|
||||
import { Tier, tankopedia } from '../core/blitz/tankopedia';
|
||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats';
|
||||
import { tankAverages } from '../core/blitzstars/tankAverages';
|
||||
import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand';
|
||||
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { theme } from '../stitches.config';
|
||||
import {
|
||||
AccountInfo,
|
||||
AllStats,
|
||||
SupplementaryStats,
|
||||
} from '../types/accountInfo.js';
|
||||
import { PlayerClanData } from '../types/playerClanData.js';
|
||||
import { PossiblyPromise } from '../types/possiblyPromise.js';
|
||||
} from '../types/accountInfo';
|
||||
import { PlayerClanData } from '../types/playerClanData';
|
||||
import { PossiblyPromise } from '../types/possiblyPromise';
|
||||
|
||||
export type StatType = 'player' | 'tank';
|
||||
|
||||
|
||||
+21
-21
@@ -1,24 +1,24 @@
|
||||
import * as Breakdown from '../components/Breakdown/index.js';
|
||||
import NoData, { NoDataType } from '../components/NoData.js';
|
||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy.js';
|
||||
import TitleBar from '../components/TitleBar.js';
|
||||
import Wrapper from '../components/Wrapper.js';
|
||||
import { BLITZ_SERVERS } from '../constants/servers.js';
|
||||
import calculateWN8 from '../core/blitz/calculateWN8.js';
|
||||
import getTankStats from '../core/blitz/getTankStats.js';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||
import resolveTankName from '../core/blitz/resolveTankName.js';
|
||||
import sumStats from '../core/blitz/sumStats.js';
|
||||
import { tankopedia } from '../core/blitz/tankopedia.js';
|
||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats.js';
|
||||
import getPeriodNow from '../core/blitzstars/getPeriodNow.js';
|
||||
import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo.js';
|
||||
import { tankAverages } from '../core/blitzstars/tankAverages.js';
|
||||
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
|
||||
import { AccountInfo, AllStats } from '../types/accountInfo.js';
|
||||
import { PlayerClanData } from '../types/playerClanData.js';
|
||||
import { PossiblyPromise } from '../types/possiblyPromise.js';
|
||||
import * as Breakdown from '../components/Breakdown';
|
||||
import NoData, { NoDataType } from '../components/NoData';
|
||||
import PoweredBy, { PoweredByType } from '../components/PoweredBy';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import Wrapper from '../components/Wrapper';
|
||||
import { BLITZ_SERVERS } from '../constants/servers';
|
||||
import calculateWN8 from '../core/blitz/calculateWN8';
|
||||
import getTankStats from '../core/blitz/getTankStats';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import resolveTankName from '../core/blitz/resolveTankName';
|
||||
import sumStats from '../core/blitz/sumStats';
|
||||
import { tankopedia } from '../core/blitz/tankopedia';
|
||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats';
|
||||
import getPeriodNow from '../core/blitzstars/getPeriodNow';
|
||||
import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo';
|
||||
import { tankAverages } from '../core/blitzstars/tankAverages';
|
||||
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand';
|
||||
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments';
|
||||
import { AccountInfo, AllStats } from '../types/accountInfo';
|
||||
import { PlayerClanData } from '../types/playerClanData';
|
||||
import { PossiblyPromise } from '../types/possiblyPromise';
|
||||
|
||||
export default async function today(
|
||||
{ server, id }: ResolvedPlayer,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import resolvePeriodFromRequest from '../core/express/resolvePeriodFromRequest.js';
|
||||
import resolvePlayerFromRequest from '../core/express/resolvePlayerFromRequest.js';
|
||||
import stats, { StatType } from '../renderers/stats.js';
|
||||
import { RouteRegistry } from '../server.js';
|
||||
import resolvePeriodFromRequest from '../core/express/resolvePeriodFromRequest';
|
||||
import resolvePlayerFromRequest from '../core/express/resolvePlayerFromRequest';
|
||||
import stats, { StatType } from '../renderers/stats';
|
||||
import { RouteRegistry } from '../server';
|
||||
|
||||
export const statsRoute: RouteRegistry = {
|
||||
route: '/stats/:type/:period',
|
||||
|
||||
Loaded 100 of 108 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user