From e6c476f948bcadc82257a67ee1245f3a5d626351 Mon Sep 17 00:00:00 2001 From: jie65535 Date: Mon, 25 Mar 2024 23:56:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0Mirai=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=88=B02.15.0=20=E4=BF=AE=E5=A4=8D=E8=BF=94=E5=9B=9Enull?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 6 +++--- gradle/wrapper/gradle-wrapper.properties | 2 +- src/main/kotlin/JDice.kt | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index cc14bc3..5951f22 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,13 +1,13 @@ plugins { - val kotlinVersion = "1.7.10" + val kotlinVersion = "1.8.10" kotlin("jvm") version kotlinVersion kotlin("plugin.serialization") version kotlinVersion - id("net.mamoe.mirai-console") version "2.14.0" + id("net.mamoe.mirai-console") version "2.15.0" } group = "top.jie65535" -version = "0.1.2" +version = "0.2.0" repositories { maven("https://maven.aliyun.com/repository/public") diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 68f4317..9847e16 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME \ No newline at end of file diff --git a/src/main/kotlin/JDice.kt b/src/main/kotlin/JDice.kt index 179b42d..fbfa28c 100644 --- a/src/main/kotlin/JDice.kt +++ b/src/main/kotlin/JDice.kt @@ -13,12 +13,12 @@ object JDice : KotlinPlugin( JvmPluginDescription( id = "top.jie65535.dice", name = "J Dice", - version = "0.1.2", + version = "0.2.0", ) { author("jie65535") } ) { - private val regex = Regex("""\b(\d{0,3})[dD](\d{1,3})\b""") + private val regex = Regex("""\b(\d{0,3})[dD]([1-9]\d{0,2})\b""") private val random = Random(System.currentTimeMillis()) override fun onEnable() { @@ -37,7 +37,7 @@ object JDice : KotlinPlugin( } else { null } - }.joinToString().let { + }.filter{ it != null }.joinToString().let { if (it.isNotEmpty()) subject.sendMessage(message.quote() + it) }