From c6f1bf9629dd640651175a78b30f5ea4ba53b34a Mon Sep 17 00:00:00 2001 From: RTAkland Date: Mon, 7 Oct 2024 12:44:31 +0800 Subject: [PATCH] fix: fix bv parse --- .../cn/rtast/fancybot/commands/parse/BVParseCommand.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/cn/rtast/fancybot/commands/parse/BVParseCommand.kt b/src/main/kotlin/cn/rtast/fancybot/commands/parse/BVParseCommand.kt index ff36103..e2fb665 100644 --- a/src/main/kotlin/cn/rtast/fancybot/commands/parse/BVParseCommand.kt +++ b/src/main/kotlin/cn/rtast/fancybot/commands/parse/BVParseCommand.kt @@ -188,6 +188,8 @@ object BVParseCommand { } else if (shortUrlRegex.containsMatchIn(message.rawMessage)) { val shortUrl = shortUrlRegex.find(message.rawMessage)!!.value getShortUrlBVID(shortUrl) + } else if (bvRegex.containsMatchIn(message.rawMessage)) { + bvRegex.find(message.rawMessage)!!.value } else if (message.message.find { it.type == ArrayMessageType.json } != null) { val card = message.message.find { it.type == ArrayMessageType.json }!! .data.data!!.toString().fromJson() @@ -200,9 +202,7 @@ object BVParseCommand { } getShortUrlBVID(shortUrl) } else { - message.rawMessage.split("?").first() - .split("/") - .last { it.isNotEmpty() && it.isNotBlank() } + return } val videoInfo = this.getVideoStat(bvid) val viewCount = this.getViewCount(bvid, videoInfo.data.cid)