Skip to content

Commit

Permalink
🚀 try catch the circles clicker player
Browse files Browse the repository at this point in the history
  • Loading branch information
asoji committed Sep 12, 2024
1 parent 731baed commit 856df18
Show file tree
Hide file tree
Showing 3 changed files with 225 additions and 64 deletions.
1 change: 1 addition & 0 deletions src/main/kotlin/one/devos/yiski/runner/Bootstrapper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ internal object Bootstrapper {
jda.listener<ReadyEvent> {
try {
logger.info { "Yiski started!" }
aviation.syncCommandsForTestGuilds(jda)
aviation.syncCommands(jda)
} catch (e: Exception) {
logger.error(e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package one.devos.yiski.common.utils

import kotlin.time.Duration

fun Duration.toTimeString() : String {
return "${zeroPad(this.inWholeMinutes - (this.inWholeHours * 60))}:${zeroPad(this.inWholeSeconds - (this.inWholeMinutes * 60))}"
}

private fun zeroPad(num: Long): String {
return if (num <= 9)
"0$num"
else
"$num"
}
Loading

0 comments on commit 856df18

Please sign in to comment.