mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8175aa8715 | ||
|
|
b426634659 | ||
|
|
e92da1b700 | ||
|
|
7e0a2e88ee | ||
|
|
16afa8c2d4 | ||
|
|
907288455a | ||
|
|
64689e4e3b | ||
|
|
294377846a | ||
|
|
70e4cbaba2 | ||
|
|
9e2f9526fb | ||
|
|
84bec20fa5 |
No files matched your search
@@ -29,4 +29,4 @@ jobs:
|
|||||||
unzip dist.zip
|
unzip dist.zip
|
||||||
|
|
||||||
- name: Run bot
|
- name: Run bot
|
||||||
run: NODE_ENV=production GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} WARGAMING_APPLICATION_ID=${{ secrets.WARGAMING_APPLICATION_ID }} node --enable-source-maps --trace-warnings bot.js
|
run: NODE_ENV=production GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} WARGAMING_APPLICATION_ID=${{ secrets.WARGAMING_APPLICATION_ID }} node --enable-source-maps --trace-warnings bot.cjs
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# Blitzkrieg 1.12.1
|
||||||
|
|
||||||
|
A duo of nasty bugs fixed.
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Fixed a tank index and id mismatch
|
||||||
|
- Reverted username pattern infrence in command username inputs
|
||||||
+1
-1
@@ -2,6 +2,6 @@
|
|||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node --enable-source-maps --trace-warnings server.js"
|
"start": "node --enable-source-maps --trace-warnings server.cjs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+5
-5
@@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "blitzkrieg",
|
"name": "blitzkrieg",
|
||||||
"version": "1.12.0",
|
"version": "1.12.1",
|
||||||
"description": "",
|
"description": "🎉 All-in-one Discord bot for everything World of Tanks Blitz",
|
||||||
"main": "src/server.ts",
|
"main": "src/server.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:bot": "vite-node --script scripts/build --build=bot",
|
"build:bot": "node scripts/build --build=bot",
|
||||||
"build:server": "vite-node --script scripts/build --build=server",
|
"build:server": "node scripts/build --build=server",
|
||||||
"build:docs": "vitepress build docs",
|
"build:docs": "vitepress build docs",
|
||||||
"build:ratingsleaderboard": "vite-node --script scripts/buildRatingsLeaderboard",
|
"build:ratingsleaderboard": "vite-node --script scripts/buildRatingsLeaderboard",
|
||||||
"build": "vite-node --script scripts/build --build=all",
|
"build": "node scripts/build --build=all",
|
||||||
"dev:bot": "yarn build:bot --dev && yarn start:bot",
|
"dev:bot": "yarn build:bot --dev && yarn start:bot",
|
||||||
"dev:server": "yarn build:server --dev && yarn start:server",
|
"dev:server": "yarn build:server --dev && yarn start:server",
|
||||||
"dev:docs": "vitepress dev docs",
|
"dev:docs": "vitepress dev docs",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { BuildOptions, build } from 'esbuild';
|
import { build } from 'esbuild';
|
||||||
import { copyFile, mkdirSync, rmSync } from 'fs';
|
import { copyFile, mkdirSync, rmSync } from 'fs';
|
||||||
import { argv } from 'process';
|
import { argv } from 'process';
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ if (isProd) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const commonOptions: BuildOptions = {
|
const commonOptions = {
|
||||||
platform: 'node',
|
platform: 'node',
|
||||||
loader: {
|
loader: {
|
||||||
'.node': 'copy',
|
'.node': 'copy',
|
||||||
@@ -1 +1 @@
|
|||||||
export const CYCLIC_API = 'https://blitzkrieg.cyclic.app';
|
export const CYCLIC_API = 'https://blitzkrieg-embeds.cyclic.app';
|
||||||
@@ -40,13 +40,15 @@ export const TANK_NAMES = new Promise<string[]>(async (resolve) => {
|
|||||||
export const TANK_NAMES_DIACRITICS = TANK_NAMES.then((tankNames) =>
|
export const TANK_NAMES_DIACRITICS = TANK_NAMES.then((tankNames) =>
|
||||||
Promise.all(
|
Promise.all(
|
||||||
tankNames.map(async (tankName, index) => {
|
tankNames.map(async (tankName, index) => {
|
||||||
const name = tankName ?? `Unknown Tank ${(await TANKS)[index].tank_id}`;
|
const id = (await TANKS)[index].tank_id;
|
||||||
|
const name = tankName ?? `Unknown Tank ${id}`;
|
||||||
const diacriticless = deburr(name);
|
const diacriticless = deburr(name);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
original: name,
|
original: name,
|
||||||
diacriticless,
|
diacriticless,
|
||||||
combined: `${name}${diacriticless}`,
|
combined: `${name}${diacriticless}`,
|
||||||
|
id,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
CacheType,
|
CacheType,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { go } from 'fuzzysort';
|
import { go } from 'fuzzysort';
|
||||||
import { TANKS, TANK_NAMES_DIACRITICS } from '../blitz/tankopedia';
|
import { TANK_NAMES_DIACRITICS } from '../blitz/tankopedia';
|
||||||
|
|
||||||
export default async function autocompleteTanks(
|
export default async function autocompleteTanks(
|
||||||
interaction: AutocompleteInteraction<CacheType>,
|
interaction: AutocompleteInteraction<CacheType>,
|
||||||
@@ -19,10 +19,10 @@ export default async function autocompleteTanks(
|
|||||||
keys: ['combined'],
|
keys: ['combined'],
|
||||||
limit: 10,
|
limit: 10,
|
||||||
}).map(
|
}).map(
|
||||||
async (item, index) =>
|
async (item) =>
|
||||||
({
|
({
|
||||||
name: item.obj.original,
|
name: item.obj.original,
|
||||||
value: `${(await TANKS)[index].tank_id}`,
|
value: `${item.obj.id}`,
|
||||||
}) satisfies ApplicationCommandOptionChoiceData<string>,
|
}) satisfies ApplicationCommandOptionChoiceData<string>,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
||||||
import { Region } from '../../constants/regions';
|
import { Region } from '../../constants/regions';
|
||||||
import listPlayers, {
|
import listPlayers, {
|
||||||
usernamePattern,
|
|
||||||
usernamePatternWithoutPosition,
|
usernamePatternWithoutPosition,
|
||||||
} from '../blitz/listPlayers';
|
} from '../blitz/listPlayers';
|
||||||
import throwError from '../node/throwError';
|
import throwError from '../node/throwError';
|
||||||
@@ -20,7 +19,7 @@ export default async function resolvePlayerFromCommand(
|
|||||||
const displayName = interaction.guild?.members.cache
|
const displayName = interaction.guild?.members.cache
|
||||||
.get(interaction.user.id)
|
.get(interaction.user.id)
|
||||||
?.displayName.match(usernamePatternWithoutPosition)?.[0];
|
?.displayName.match(usernamePatternWithoutPosition)?.[0];
|
||||||
const username = commandUsername?.match(usernamePattern)?.[0] ?? displayName;
|
const username = commandUsername ?? displayName;
|
||||||
|
|
||||||
if (username === undefined) {
|
if (username === undefined) {
|
||||||
throw throwError(
|
throw throwError(
|
||||||
|
|||||||
Reference in new issue
Block a user