Skip to content

Commit

Permalink
Enable Kord stacktrace recovery in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
gdude2002 committed Nov 21, 2024
1 parent def6294 commit 42826ff
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ import dev.kord.gateway.builder.PresenceBuilder
import dev.kord.gateway.builder.Shards
import dev.kord.rest.builder.message.allowedMentions
import dev.kord.rest.builder.message.create.MessageCreateBuilder
import dev.kordex.core.DATA_COLLECTION
import dev.kordex.core.DEV_MODE
import dev.kordex.core.ExtensibleBot
import dev.kordex.core.KORDEX_GIT_BRANCH
import dev.kordex.core.KORDEX_GIT_HASH
import dev.kordex.core.KORDEX_VERSION
import dev.kordex.core.KORD_VERSION
import dev.kordex.core.*
import dev.kordex.core.annotations.BotBuilderDSL
import dev.kordex.core.annotations.InternalAPI
import dev.kordex.core.commands.application.ApplicationCommandRegistry
Expand Down Expand Up @@ -530,6 +524,16 @@ public open class ExtensibleBotBuilder {
"and Kord v$KORD_VERSION"
}

if (devMode) {
logger.info {
"Running in development mode - enabling development helpers."
}

kord {
stackTraceRecovery = true
}
}

hooksBuilder.beforeKoinSetup { // We have to do this super-duper early for safety
loadModule { single { dataAdapterCallback() } bind DataAdapter::class }
}
Expand Down

0 comments on commit 42826ff

Please sign in to comment.