Skip to content

Commit

Permalink
Fix: stats for today showed a random day, now showing today
Browse files Browse the repository at this point in the history
  • Loading branch information
oglimmer committed Feb 3, 2024
1 parent 4eb6269 commit 2849eb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/buttons/elite-stats-page3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
buttonId: /elite-stats-page3/,
async execute(interaction: ButtonInteraction): Promise<void> {
const stats = await EliteGameDataStorage.instance().loadTodaysPlayers()
console.log(stats)
const rows = Array.from({ length: Math.min(11, stats.length) }, (_, index) => createRow(stats, index))
await interaction.update({
embeds: [
Expand Down
2 changes: 1 addition & 1 deletion src/service/eliteGameDataStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,6 @@ export class EliteGameDataStorage {
if (!this.db) {
throw Error('initEliteGame was not called!')
}
return await this.db.allAsyncT<{ userId: string }>(`select player as userId from elite_game where register_date = (select max(register_date) from elite_game where player = "\uFFFF") and player != "\uFFFF" order by play_timestamp desc`, [])
return await this.db.allAsyncT<{ userId: string }>(`select player as userId from elite_game where register_date = (select register_date from elite_game where identifier = (select max(identifier) from elite_game where player = "\uFFFF")) and player != "\uFFFF" order by play_timestamp desc`, [])
}
}

0 comments on commit 2849eb9

Please sign in to comment.