proper playtime format
This commit is contained in:
parent
a2f2d59fa4
commit
57f91861d0
1 changed files with 12 additions and 2 deletions
|
@ -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`)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue