From 9cdd43e9afdd89ecd920b8ef383edac3e1cdbcd8 Mon Sep 17 00:00:00 2001 From: Jejebecarte <69335633+Jejebecarte@users.noreply.github.com> Date: Sat, 2 Mar 2024 02:51:24 +1100 Subject: [PATCH] feat: format gexp replies in whisper event (#202) --- src/events/mineflayer/chat/whisper.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/events/mineflayer/chat/whisper.ts b/src/events/mineflayer/chat/whisper.ts index 3bd4be78..93ed317c 100644 --- a/src/events/mineflayer/chat/whisper.ts +++ b/src/events/mineflayer/chat/whisper.ts @@ -23,11 +23,9 @@ export default { } const member = playerGuild.members.find((guildMember) => guildMember.uuid === mojangProfile.id); - bot.executeCommand( - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - `/w ${playerName} ${target}'s total weekly gexp: ${Object.values(member!.expHistory).reduce( - (previous, current) => previous + current, - )}`, - ); + + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const gexp = Object.values(member!.expHistory).reduce((previous, current) => previous + current); + bot.executeCommand(`/w ${playerName} ${target}'s total weekly gexp: ${gexp.toLocaleString()}`); }, } as Event;