mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 15:57:47 +02:00
Fix
This commit is contained in:
@@ -44,13 +44,13 @@ module.exports = class LastRunLeaderboardCommand extends Command {
|
|||||||
return commands
|
return commands
|
||||||
.sort((a, b) => a.lastRun ? b.lastRun - a.lastRun : 1)
|
.sort((a, b) => a.lastRun ? b.lastRun - a.lastRun : 1)
|
||||||
.map(command => {
|
.map(command => {
|
||||||
if (previousPts === command.lastRun.toISOString()) {
|
if (previousPts === command.lastRun || previousPts === command.lastRun.toISOString()) {
|
||||||
positionsMoved++;
|
positionsMoved++;
|
||||||
} else {
|
} else {
|
||||||
i += positionsMoved;
|
i += positionsMoved;
|
||||||
positionsMoved = 1;
|
positionsMoved = 1;
|
||||||
}
|
}
|
||||||
previousPts = command.lastRun.toISOString();
|
previousPts = command.lastRun ? command.lastRun.toISOString() : null;
|
||||||
const displayTime = command.lastRun ? moment.utc(command.lastRun).format('MM/DD/YYYY h:mm A') : null;
|
const displayTime = command.lastRun ? moment.utc(command.lastRun).format('MM/DD/YYYY h:mm A') : null;
|
||||||
return `**${i}.** ${command.name} (${displayTime || 'Never'})`;
|
return `**${i}.** ${command.name} (${displayTime || 'Never'})`;
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user