Skip to content

Commit

Permalink
Sentry stuff (#99)
Browse files Browse the repository at this point in the history
* Small Sentry tweak
  • Loading branch information
gdude2002 authored Mar 22, 2024
1 parent fc4cbd7 commit d4dfe92
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/kotlin/org/quiltmc/community/_Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import dev.kord.core.entity.channel.GuildMessageChannel
import dev.kord.rest.builder.message.EmbedBuilder
import dev.kord.rest.request.RestRequestException
import kotlinx.coroutines.runBlocking
import mu.KotlinLogging
import org.koin.dsl.bind
import org.quiltmc.community.database.Database
import org.quiltmc.community.database.collections.*
Expand Down Expand Up @@ -131,6 +132,8 @@ suspend fun ExtensibleBotBuilder.database(migrate: Boolean = false) {
}

suspend fun ExtensibleBotBuilder.common() {
val logger = KotlinLogging.logger { }

dataAdapter(::MongoDBDataAdapter)

applicationCommands {
Expand All @@ -140,13 +143,12 @@ suspend fun ExtensibleBotBuilder.common() {

extensions {
sentry {
val sentryDsn = envOrNull("SENTRY_DSN")
val version: String? = object {}::class.java.`package`.implementationVersion

if (sentryDsn != null) {
enable = true
enableIfDSN(envOrNull("SENTRY_DSN"))

dsn = sentryDsn
if (enable) {
logger.info { "Sentry enabled." }
}

if (version != null) {
Expand Down

0 comments on commit d4dfe92

Please sign in to comment.