From 7c948a3e6e7d23289755ab3e56433ff4888c11c7 Mon Sep 17 00:00:00 2001 From: sschr15 Date: Wed, 6 Dec 2023 19:36:13 -0600 Subject: [PATCH] another sentry attempt --- .../kotlin/org/quiltmc/community/_Utils.kt | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/org/quiltmc/community/_Utils.kt b/src/main/kotlin/org/quiltmc/community/_Utils.kt index 4ea2bf7..7ecdb0a 100644 --- a/src/main/kotlin/org/quiltmc/community/_Utils.kt +++ b/src/main/kotlin/org/quiltmc/community/_Utils.kt @@ -191,15 +191,18 @@ suspend fun ExtensibleBotBuilder.common() { extensions { val sentryDsn = envOrNull("SENTRY_DSN") - if (sentryDsn != null) { - sentry { - enable = true - dsn = sentryDsn - } - } else { - sentry { - enable = false - dsn = "" // why is it like this + sentry { + enableIfDSN(sentryDsn) + setupCallback = { + init { + dsn = sentryDsn ?: "" + isEnabled = sentryDsn != null + isDebug = debug + dist = distribution + environment = this@sentry.environment + release = this@sentry.release + serverName = this@sentry.serverName + } } }