Skip to content

Commit

Permalink
feat: format gexp replies in whisper event (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
jejebecarte authored Mar 1, 2024
1 parent ad5b2c1 commit 9cdd43e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/events/mineflayer/chat/whisper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 9cdd43e

Please sign in to comment.