From 8f62737625235a7f13750e33eca90a137e2c45b5 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Tue, 12 Nov 2024 20:21:26 +0100 Subject: [PATCH] Fix discord sound detection --- .../kotlin/dev/schlaubi/tonbrett/bot/server/SoundsRoute.kt | 3 +-- build.gradle.kts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bot/src/main/kotlin/dev/schlaubi/tonbrett/bot/server/SoundsRoute.kt b/bot/src/main/kotlin/dev/schlaubi/tonbrett/bot/server/SoundsRoute.kt index a95ddd9..965efb2 100644 --- a/bot/src/main/kotlin/dev/schlaubi/tonbrett/bot/server/SoundsRoute.kt +++ b/bot/src/main/kotlin/dev/schlaubi/tonbrett/bot/server/SoundsRoute.kt @@ -29,10 +29,9 @@ import io.ktor.server.routing.Route import kotlinx.coroutines.delay import kotlinx.coroutines.flow.toList import org.bson.types.ObjectId -import org.litote.kmongo.toId import kotlin.time.Duration.Companion.milliseconds -private val discordIdPattern = Regex("\\d{18,}") +private val discordIdPattern = Regex("\\d(?:\\d{17,})?") @OptIn(KordUnsafe::class, KordExperimental::class) fun Route.sounds() { diff --git a/build.gradle.kts b/build.gradle.kts index ce691ae..53fa967 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { allprojects { group = "dev.schlaubi.tonbrett" - version = "2.1.4" + version = "2.1.5" repositories { mavenCentral()