diff --git a/docs/changelogs/1.12.5.md b/docs/changelogs/1.12.5.md index e99703bef..65e6fd32e 100644 --- a/docs/changelogs/1.12.5.md +++ b/docs/changelogs/1.12.5.md @@ -1,4 +1,4 @@ -# Blitzkrieg 1.12.4 +# Blitzkrieg 1.12.5 Some patch up work @@ -6,7 +6,7 @@ Some patch up work - `/clan-event` now is more legible and comes with an approximation warning -## Fixed +## Fixes - `/clan-event` now uses a more optimized way of fetching large data - This should fix the issue where too many people using the command broke it diff --git a/docs/changelogs/1.12.6.md b/docs/changelogs/1.12.6.md new file mode 100644 index 000000000..347c948a1 --- /dev/null +++ b/docs/changelogs/1.12.6.md @@ -0,0 +1,12 @@ +# Blitzkrieg 1.12.6 + +Stops making the bot lie! + +## Changes + +- The approximation warning for `/clan-event` has been made more concise +- Players with `0` wins are now omitted + +## Fixes + +- Players who haven't player within the current day are now omitted diff --git a/package.json b/package.json index 7e3054a9b..372d592ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blitzkrieg", - "version": "1.12.1", + "version": "1.12.6", "description": "🎉 All-in-one Discord bot for everything World of Tanks Blitz", "main": "src/server.ts", "type": "module", diff --git a/scripts/build.js b/scripts/build.js index d334ec3a6..9e124599e 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -26,7 +26,9 @@ files.forEach(async (file) => { bundle: true, sourcemap: true, - minify: true, + minifyIdentifiers: false, // cause goofy errors + minifySyntax: true, + minifyWhitespace: true, logLevel: 'info', }); diff --git a/src/commands/clanEvent.ts b/src/commands/clanEvent.ts index 18e133cd1..ab68f374f 100644 --- a/src/commands/clanEvent.ts +++ b/src/commands/clanEvent.ts @@ -2,6 +2,7 @@ import { SlashCommandBuilder } from 'discord.js'; import markdownEscape from 'markdown-escape'; import getWargamingResponse from '../core/blitz/getWargamingResponse'; import { PlayerHistoriesRaw } from '../core/blitzstars/getPlayerHistories'; +import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo'; import addClanChoices from '../core/discord/addClanChoices'; import autocompleteClan from '../core/discord/autocompleteClan'; import embedWarning from '../core/discord/embedWarning'; @@ -16,7 +17,6 @@ const DEFAULT_THRESHOLD = 7; export const clanEventCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, inPublic: true, command: new SlashCommandBuilder() @@ -63,10 +63,12 @@ export const clanEventCommand: CommandRegistry = { const jointVictories = clan.members_ids.map((id) => ({ id, joinVictory: - previousJointVictories[id] === undefined - ? 0 - : achievements[id].max_series.jointVictory - - previousJointVictories[id]!, + players[id].last_battle_time > getTimeDaysAgo(region, 1) + ? previousJointVictories[id] === undefined + ? 0 + : achievements[id].max_series.jointVictory - + previousJointVictories[id]! + : 0, })); return [ @@ -76,6 +78,7 @@ export const clanEventCommand: CommandRegistry = { 0, ) / 2 ).toFixed(0)}\n${jointVictories + .filter(({ joinVictory }) => joinVictory) .sort((a, b) => b.joinVictory - a.joinVictory) .map( ({ id, joinVictory }) => @@ -85,7 +88,7 @@ export const clanEventCommand: CommandRegistry = { embedWarning( 'This is an approximation!', - 'Wargaming provides use with little to no information about platoons. Platooning with mixed clans may inflate the number and platooning in non-regular battles may deflate.', + "Wargaming provides very little information about platoons publicly. Caveats:\n- Players in two different clans platooning artificially inflates the total count\n- Game-mode battles aren't counted since Wargaming doesn't track them", ), ]; },