diff --git a/core/src/commonMain/kotlin/Kord.kt b/core/src/commonMain/kotlin/Kord.kt index 112657aa2341..2e1fc9c37d8c 100644 --- a/core/src/commonMain/kotlin/Kord.kt +++ b/core/src/commonMain/kotlin/Kord.kt @@ -45,17 +45,18 @@ import kotlinx.coroutines.channels.Channel as CoroutineChannel public val kordLogger: mu.KLogger = mu.KotlinLogging.logger { } private val logger = KotlinLogging.logger { } -private val messageLinkRegex = """(?x) # enable comments -| (?i) # allow ignore case -| (?:https?+://)?+ # https:// (or also http:// or an empty string) -| (?:(?:canary|ptb)\\.)?+ # canary. or ptb. -| discord(?:app)?+\\.com/channels/ # discord(app).com/channels/ -| (?:(?[0-9]++)|@me) # @me or the server id -| / # '/' -| (?[0-9]++) # the channel id (should only be a message channel) -| / # '/' -| (?[0-9]++) # the message id -| """.trimMargin().toRegex() +private val messageLinkRegex = """ + |(?x) # enable comments + |(?i) # allow ignore case + |(?:https?+://)?+ # https:// (or also http:// or an empty string) + |(?:(?:canary|ptb)\.)?+ # canary. or ptb. + |discord(?:app)?+\.com/channels/ # discord(app).com/channels/ + |(?:(?[0-9]++)|@me) # @me or the server id + |/ # '/' + |(?[0-9]++) # the channel id (should only be a message channel) + |/ # '/' + |(?[0-9]++) # the message id + """.trimMargin().toRegex() @PublishedApi internal fun logCaughtThrowable(throwable: Throwable): Unit = logger.catching(throwable)