proper playtime format

This commit is contained in:
1e99 2025-07-21 20:11:47 +02:00
parent a2f2d59fa4
commit 57f91861d0

View file

@ -39,7 +39,17 @@ export default class PlaytimeCommand extends Command {
return
}
const playtime = data["playtime"]
this.#chat.chat(`${target} has played for ${playtime}s`)
let playtime = data["playtime"]
const days = Math.floor(playtime / (24 * 3600))
playtime %= (24 * 3600)
const hours = Math.floor(playtime / 3600)
playtime %= 3600
const minutes = Math.floor(playtime / 60)
playtime %= 60
this.#chat.chat(`${target} has played for ${days}d ${hours}h ${minutes}m ${playtime}s`)
}
}