Skip to content

Commit

Permalink
fix better layout
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-flip committed Mar 15, 2024
1 parent ec867a6 commit 010f3ee
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions functions/ENGINE/limitedRp.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function postLeaderboard() {
.sort((a, b) => a.points - b.points)
// discord field limit
.slice(0, 25)
.map((entry) => ({ name: `${entry.id}`, value: `<@${entry.id}> - ${entry.points} P - ${entry.warnLevel} WL` }));
.map((entry) => ({ name: `${entry.id}`, value: `<@${entry.id}>\n${entry.points} points\n${entry.warnLevel} warning level` }));
const embed = new EmbedBuilder()
.setFooter({
text: `Highest warn level is ${config.reducedRP.warnThresholds.length} at ${config.reducedRP.warnThresholds[config.reducedRP.warnThresholds.length - 1]} points.`,
Expand Down Expand Up @@ -67,7 +67,7 @@ module.exports.run = async (message) => {
// overflow protection
if (activeUser.warnLevel === config.reducedRP.warnThresholds.length) return true;
activeUser.warnLevel += 1;
// reset points to warn threshold
// reset points to warn threshold, so it fair and user goes through each stage
activeUser.points = config.reducedRP.warnThresholds[activeUser.warnLevel - 1];
// TODO: Inform user
return false;
Expand All @@ -81,8 +81,6 @@ module.exports.run = async (message) => {
}
return true;
});
console.log(activeUser);
// if warn increased, higher warn level by one point and use that as index to reset to that level of points

// update lastPointsDeletion when points where adjusted
if (points !== 0) activeUser.lastPointsDeletion = Date.now();
Expand Down

0 comments on commit 010f3ee

Please sign in to comment.