Browse Source

Merge branch 'dev' into android_target

# Conflicts:
#	build.gradle.kts
Him188 5 years ago
parent
commit
aaab3ae109

+ 37 - 21
binary-compatibility-validator/api/binary-compatibility-validator.api

@@ -482,7 +482,8 @@ public abstract interface class net/mamoe/mirai/contact/NormalMember : net/mamoe
 public final class net/mamoe/mirai/contact/NormalMemberKt {
 	public static final fun getNameCardOrNick (Lnet/mamoe/mirai/contact/User;)Ljava/lang/String;
 	public static final fun isMuted (Lnet/mamoe/mirai/contact/NormalMember;)Z
-	public static final fun mute-fcu0wV4 (Lnet/mamoe/mirai/contact/NormalMember;DLkotlin/coroutines/Continuation;)Ljava/lang/Object;
+	public static final fun mute-8Mi8wO0 (Lnet/mamoe/mirai/contact/NormalMember;DLkotlin/coroutines/Continuation;)Ljava/lang/Object;
+	public static final synthetic fun mute-fcu0wV4 (Lnet/mamoe/mirai/contact/NormalMember;DLkotlin/coroutines/Continuation;)Ljava/lang/Object;
 }
 
 public abstract interface class net/mamoe/mirai/contact/OtherClient : net/mamoe/mirai/contact/Contact {
@@ -1630,12 +1631,12 @@ public abstract class net/mamoe/mirai/event/MessageSelectBuilder : net/mamoe/mir
 	public synthetic fun quoteReply (Lnet/mamoe/mirai/event/MessageSubscribersBuilder$ListeningFilter;Lkotlin/jvm/functions/Function3;)Ljava/lang/Void;
 	public synthetic fun quoteReply (Lnet/mamoe/mirai/event/MessageSubscribersBuilder$ListeningFilter;Lnet/mamoe/mirai/message/data/Message;)Ljava/lang/Object;
 	public synthetic fun quoteReply (Lnet/mamoe/mirai/event/MessageSubscribersBuilder$ListeningFilter;Lnet/mamoe/mirai/message/data/Message;)Ljava/lang/Void;
-	public synthetic fun quoteReply-AVDwu3U (JLnet/mamoe/mirai/message/data/Message;)Ljava/lang/Void;
-	public synthetic fun quoteReply-AVDwu3U (JLnet/mamoe/mirai/message/data/Message;)V
-	public synthetic fun quoteReply-RNyhSv4 (JLkotlin/jvm/functions/Function1;)Ljava/lang/Void;
-	public synthetic fun quoteReply-RNyhSv4 (JLkotlin/jvm/functions/Function1;)V
-	public synthetic fun quoteReply-sCZ5gAI (JLjava/lang/String;)Ljava/lang/Void;
-	public synthetic fun quoteReply-sCZ5gAI (JLjava/lang/String;)V
+	public synthetic fun quoteReply-8NSq9Eo (JLjava/lang/String;)Ljava/lang/Void;
+	public synthetic fun quoteReply-8NSq9Eo (JLjava/lang/String;)V
+	public synthetic fun quoteReply-8NSq9Eo (JLkotlin/jvm/functions/Function1;)Ljava/lang/Void;
+	public synthetic fun quoteReply-8NSq9Eo (JLkotlin/jvm/functions/Function1;)V
+	public synthetic fun quoteReply-8NSq9Eo (JLnet/mamoe/mirai/message/data/Message;)Ljava/lang/Void;
+	public synthetic fun quoteReply-8NSq9Eo (JLnet/mamoe/mirai/message/data/Message;)V
 	public synthetic fun reply (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;
 	public synthetic fun reply (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Void;
 	public synthetic fun reply (Ljava/lang/String;Lkotlin/jvm/functions/Function3;)Ljava/lang/Object;
@@ -1648,12 +1649,12 @@ public abstract class net/mamoe/mirai/event/MessageSelectBuilder : net/mamoe/mir
 	public synthetic fun reply (Lnet/mamoe/mirai/event/MessageSubscribersBuilder$ListeningFilter;Lkotlin/jvm/functions/Function3;)Ljava/lang/Void;
 	public synthetic fun reply (Lnet/mamoe/mirai/event/MessageSubscribersBuilder$ListeningFilter;Lnet/mamoe/mirai/message/data/Message;)Ljava/lang/Object;
 	public synthetic fun reply (Lnet/mamoe/mirai/event/MessageSubscribersBuilder$ListeningFilter;Lnet/mamoe/mirai/message/data/Message;)Ljava/lang/Void;
-	public synthetic fun reply-AVDwu3U (JLnet/mamoe/mirai/message/data/Message;)Ljava/lang/Void;
-	public synthetic fun reply-AVDwu3U (JLnet/mamoe/mirai/message/data/Message;)V
-	public synthetic fun reply-RNyhSv4 (JLkotlin/jvm/functions/Function1;)Ljava/lang/Void;
-	public synthetic fun reply-RNyhSv4 (JLkotlin/jvm/functions/Function1;)V
-	public synthetic fun reply-sCZ5gAI (JLjava/lang/String;)Ljava/lang/Void;
-	public synthetic fun reply-sCZ5gAI (JLjava/lang/String;)V
+	public synthetic fun reply-8NSq9Eo (JLjava/lang/String;)Ljava/lang/Void;
+	public synthetic fun reply-8NSq9Eo (JLjava/lang/String;)V
+	public synthetic fun reply-8NSq9Eo (JLkotlin/jvm/functions/Function1;)Ljava/lang/Void;
+	public synthetic fun reply-8NSq9Eo (JLkotlin/jvm/functions/Function1;)V
+	public synthetic fun reply-8NSq9Eo (JLnet/mamoe/mirai/message/data/Message;)Ljava/lang/Void;
+	public synthetic fun reply-8NSq9Eo (JLnet/mamoe/mirai/message/data/Message;)V
 }
 
 public abstract class net/mamoe/mirai/event/MessageSelectBuilderUnit : net/mamoe/mirai/event/MessageSubscribersBuilder {
@@ -1663,17 +1664,32 @@ public abstract class net/mamoe/mirai/event/MessageSelectBuilderUnit : net/mamoe
 	public abstract fun default (Lkotlin/jvm/functions/Function3;)V
 	public final fun defaultQuoteReply (Lkotlin/jvm/functions/Function1;)V
 	public final fun defaultReply (Lkotlin/jvm/functions/Function1;)V
-	public final fun invoke-RNyhSv4 (JLkotlin/jvm/functions/Function1;)V
+	public final fun invoke-8NSq9Eo (JLkotlin/jvm/functions/Function1;)V
+	public final synthetic fun invoke-RNyhSv4 (JLkotlin/jvm/functions/Function1;)Ljava/lang/Void;
+	public final synthetic fun invoke-RNyhSv4 (JLkotlin/jvm/functions/Function1;)V
 	protected abstract fun obtainCurrentCoroutineScope ()Lkotlinx/coroutines/CoroutineScope;
 	protected abstract fun obtainCurrentDeferred ()Lkotlinx/coroutines/CompletableDeferred;
-	public fun quoteReply-AVDwu3U (JLnet/mamoe/mirai/message/data/Message;)V
-	public fun quoteReply-RNyhSv4 (JLkotlin/jvm/functions/Function1;)V
-	public fun quoteReply-sCZ5gAI (JLjava/lang/String;)V
-	public fun reply-AVDwu3U (JLnet/mamoe/mirai/message/data/Message;)V
-	public fun reply-RNyhSv4 (JLkotlin/jvm/functions/Function1;)V
-	public fun reply-sCZ5gAI (JLjava/lang/String;)V
+	public fun quoteReply-8NSq9Eo (JLjava/lang/String;)V
+	public fun quoteReply-8NSq9Eo (JLkotlin/jvm/functions/Function1;)V
+	public fun quoteReply-8NSq9Eo (JLnet/mamoe/mirai/message/data/Message;)V
+	public final synthetic fun quoteReply-AVDwu3U (JLnet/mamoe/mirai/message/data/Message;)Ljava/lang/Void;
+	public final synthetic fun quoteReply-AVDwu3U (JLnet/mamoe/mirai/message/data/Message;)V
+	public final synthetic fun quoteReply-RNyhSv4 (JLkotlin/jvm/functions/Function1;)Ljava/lang/Void;
+	public final synthetic fun quoteReply-RNyhSv4 (JLkotlin/jvm/functions/Function1;)V
+	public final synthetic fun quoteReply-sCZ5gAI (JLjava/lang/String;)Ljava/lang/Void;
+	public final synthetic fun quoteReply-sCZ5gAI (JLjava/lang/String;)V
+	public fun reply-8NSq9Eo (JLjava/lang/String;)V
+	public fun reply-8NSq9Eo (JLkotlin/jvm/functions/Function1;)V
+	public fun reply-8NSq9Eo (JLnet/mamoe/mirai/message/data/Message;)V
+	public final synthetic fun reply-AVDwu3U (JLnet/mamoe/mirai/message/data/Message;)Ljava/lang/Void;
+	public final synthetic fun reply-AVDwu3U (JLnet/mamoe/mirai/message/data/Message;)V
+	public final synthetic fun reply-RNyhSv4 (JLkotlin/jvm/functions/Function1;)Ljava/lang/Void;
+	public final synthetic fun reply-RNyhSv4 (JLkotlin/jvm/functions/Function1;)V
+	public final synthetic fun reply-sCZ5gAI (JLjava/lang/String;)Ljava/lang/Void;
+	public final synthetic fun reply-sCZ5gAI (JLjava/lang/String;)V
 	public final fun timeout (JLkotlin/jvm/functions/Function1;)V
-	public final fun timeout-ncvN2qU (J)J
+	public final fun timeout-1WcQj8o (J)J
+	public final synthetic fun timeout-ncvN2qU (J)J
 	public final fun timeoutException (JLkotlin/jvm/functions/Function0;)V
 	public static synthetic fun timeoutException$default (Lnet/mamoe/mirai/event/MessageSelectBuilderUnit;JLkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
 }

+ 40 - 9
build.gradle.kts

@@ -199,16 +199,47 @@ fun Project.configureMppShadow() {
             }
 
             /*
-            this.manifest {
-                this.attributes(
-                    "Manifest-Version" to 1,
-                    "Implementation-Vendor" to "Mamoe Technologies",
-                    "Implementation-Title" to this.name.toString(),
-                    "Implementation-Version" to this.version.toString()
-                )
-            }*/
+        this.manifest {
+            this.attributes(
+                "Manifest-Version" to 1,
+                "Implementation-Vendor" to "Mamoe Technologies",
+                "Implementation-Title" to this.name.toString(),
+                "Implementation-Version" to this.version.toString()
+            )
+        }*/
         }
+    }
 
+    fun Project.configureEncoding() {
+        tasks.withType(JavaCompile::class.java) {
+            options.encoding = "UTF8"
+        }
     }
 
-}
+    fun Project.configureKotlinTestSettings() {
+        tasks.withType(Test::class) {
+            useJUnitPlatform()
+        }
+        when {
+            isKotlinJvmProject -> {
+                dependencies {
+                    testImplementation(kotlin("test-junit5"))
+
+                    testApi("org.junit.jupiter:junit-jupiter-api:5.2.0")
+                    testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.2.0")
+                }
+            }
+            isKotlinMpp -> {
+                kotlinSourceSets?.forEach { sourceSet ->
+                    if (sourceSet.name.endsWith("test", ignoreCase = true)) {
+                        sourceSet.dependencies {
+                            api(kotlin("test-junit5"))
+                            api("org.junit.jupiter:junit-jupiter-api:5.2.0")
+                            runtimeOnly("org.junit.jupiter:junit-jupiter-engine:5.2.0")
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 9 - 9
buildSrc/src/main/kotlin/Versions.kt

@@ -18,16 +18,16 @@ object Versions {
     const val console = project
     const val consoleTerminal = project
 
-    const val kotlinCompiler = "1.4.21"
-    const val kotlinStdlib = "1.4.21"
+    const val kotlinCompiler = "1.4.30"
+    const val kotlinStdlib = "1.4.30"
     const val dokka = "1.4.20"
 
-    const val coroutines = "1.4.1"
-    const val atomicFU = "0.14.4"
-    const val serialization = "1.0.1"
-    const val ktor = "1.5.0"
+    const val coroutines = "1.4.2"
+    const val atomicFU = "0.15.1"
+    const val serialization = "1.1.0-RC"
+    const val ktor = "1.5.1"
 
-    const val binaryValidator = "0.3.0"
+    const val binaryValidator = "0.4.0"
 
     const val io = "0.1.16"
     const val coroutinesIo = "0.1.16"
@@ -49,8 +49,8 @@ object Versions {
 
     const val yamlkt = "0.7.5"
     const val intellijGradlePlugin = "0.4.16"
-    const val kotlinIntellijPlugin = "203-1.4.21-release-IJ5981.133" // keep to newest as kotlinCompiler
-    const val intellij = "2020.3" // don't update easily unless you want your disk space -= 500MB
+    const val kotlinIntellijPlugin = "203-1.4.30-release-IJ7148.5" // keep to newest as kotlinCompiler
+    const val intellij = "2020.3.2" // don't update easily unless you want your disk space -= 500MB
 
 }
 

+ 8 - 29
docs/ConfiguringProjects.md

@@ -11,8 +11,8 @@
 
 | 版本类型 |             版本号              |
 |:------:|:------------------------------:|
-|  稳定   |             2.3.2              |
-|  预览   |             2.4-RC              |
+|  稳定   |             2.4.0              |
+|  预览   |               -                |
 |  开发   | [![Version]][Bintray Download] |
 
 ### 配置项目
@@ -35,12 +35,8 @@ plugins {
     kotlin("jvm") version "1.4.21" // 请确保添加 Kotlin,至少使用 1.4.0 版本
 }
 
-repositories {
-    jcenter()
-}
-
 dependencies {
-    api("net.mamoe", "mirai-core", "2.3.2") // 替换为你需要的版本号
+    api("net.mamoe", "mirai-core", "2.4.0")
 }
 ```
 
@@ -56,15 +52,11 @@ dependencies {
 
 ```groovy
 plugins {
-    id 'org.jetbrains.kotlin.jvm' version '1.4.21' // 请确保添加 Kotlin,至少使用 1.4.0 版本
-}
-
-repositories {
-    jcenter()
+    id 'org.jetbrains.kotlin.jvm' version '1.4.21' // 确保添加 Kotlin
 }
 
 dependencies {
-    api('net.mamoe', 'mirai-core', '2.3.2') // 替换为你需要的版本号
+    api('net.mamoe', 'mirai-core', '2.4.0')
 }
 ```
 
@@ -77,7 +69,7 @@ dependencies {
 mirai 在开发时需要 `net.mamoe:mirai-core-api`, 在运行时需要 `net.mamoe:mirai-core`。可以在开发和编译时只依赖 `mirai-core-api`,会减轻对 IDE 的负担。
 ```kotlin
 dependencies {
-    val miraiVersion = "2.3.2" // 替换为你需要的版本号
+    val miraiVersion = "2.4.0"
     api("net.mamoe", "mirai-core-api", miraiVersion)     // 编译代码使用
     runtimeOnly("net.mamoe", "mirai-core", miraiVersion) // 运行时使用
 }
@@ -86,33 +78,20 @@ dependencies {
 
 ## B. 使用 Maven
 
-在 `pom.xml` 中:
-
-### 1. 添加 jcenter 仓库
-```xml
-<repositories>
-    <repository>
-        <id>jcenter</id>
-        <url>https://jcenter.bintray.com/</url>
-    </repository>
-</repositories>
-```
-
-### 2. 添加 mirai 依赖
+在 `pom.xml` 中添加 mirai 依赖:
 
 ```xml
 <dependencies>
     <dependency>
         <groupId>net.mamoe</groupId>
         <artifactId>mirai-core-jvm</artifactId>
-        <version>2.3.2</version> <!-- 替换版本为你需要的版本 -->
+        <version>2.4.0</version> <!-- 替换版本为你需要的版本 -->
     </dependency>
 </dependencies>
 ```
 
 > 注意在 Maven,artifactId 要使用带 `-jvm` 后缀的
 
-### 3. 添加 Kotlin 依赖
 
 通常 mirai 可以直接使用。但 mirai 使用的 Kotlin 1.4 可能与你的项目使用的其他库依赖的 Kotlin 版本冲突,Maven 有时候无法正确处理这种冲突。此时请手动添加 Kotlin 标准库依赖。
 

+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -6,7 +6,7 @@
 #
 #  https://github.com/mamoe/mirai/blob/master/LICENSE
 #
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStorePath=wrapper/dists

+ 1 - 1
mirai-console

@@ -1 +1 @@
-Subproject commit 086604ce67792ae835b3cf34e1b41edf11d0e7d6
+Subproject commit d25ffb094b7c3256bca755553bf0584c8c6567cd

+ 7 - 0
mirai-core-api/src/commonMain/kotlin/contact/NormalMember.kt

@@ -167,3 +167,10 @@ public suspend inline fun NormalMember.mute(duration: Duration) {
     require(duration.inSeconds > 0) { "duration must be greater than 0 second" }
     this.mute(duration.inSeconds.toInt())
 }
+
+@Suppress("unused")
+@JvmName("mute-fcu0wV4")
+@Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+public suspend inline fun NormalMember.mute00(duration: Duration) {
+    return mute(duration)
+}

+ 101 - 0
mirai-core-api/src/commonMain/kotlin/event/select.kt

@@ -387,6 +387,107 @@ public abstract class MessageSelectBuilderUnit<M : MessageEvent, R> @PublishedAp
         }
     }
 
+
+    @JvmName("timeout-ncvN2qU")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public fun timeout00(timeoutMillis: Long): MessageSelectionTimeoutChecker {
+        return timeout(timeoutMillis)
+    }
+
+    @Suppress("unused")
+    @JvmName("invoke-RNyhSv4")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public fun MessageSelectionTimeoutChecker.invoke00(block: suspend () -> R) {
+        return invoke(block)
+    }
+
+    @Suppress("unused")
+    @JvmName("invoke-RNyhSv4")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public fun MessageSelectionTimeoutChecker.invoke000(block: suspend () -> R): Void? {
+        invoke(block)
+        return null
+    }
+
+    @JvmName("reply-RNyhSv4")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public infix fun MessageSelectionTimeoutChecker.reply00(block: suspend () -> Any?) {
+        return reply(block)
+    }
+
+    @JvmName("reply-RNyhSv4")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public infix fun MessageSelectionTimeoutChecker.reply000(block: suspend () -> Any?): Void? {
+        reply(block)
+        return null
+    }
+
+    @JvmName("reply-sCZ5gAI")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public infix fun MessageSelectionTimeoutChecker.reply00(message: String) {
+        return reply(message)
+    }
+
+    @JvmName("reply-sCZ5gAI")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public infix fun MessageSelectionTimeoutChecker.reply000(message: String): Void? {
+        reply(message)
+        return null
+    }
+
+    @JvmName("reply-AVDwu3U")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public infix fun MessageSelectionTimeoutChecker.reply00(message: Message) {
+        return reply(message)
+    }
+
+    @JvmName("reply-AVDwu3U")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public infix fun MessageSelectionTimeoutChecker.reply000(message: Message): Void? {
+        reply(message)
+        return null
+    }
+
+
+    @JvmName("quoteReply-RNyhSv4")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public infix fun MessageSelectionTimeoutChecker.quoteReply00(block: suspend () -> Any?) {
+        return reply(block)
+    }
+
+    @JvmName("quoteReply-RNyhSv4")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public infix fun MessageSelectionTimeoutChecker.quoteReply000(block: suspend () -> Any?): Void? {
+        reply(block)
+        return null
+    }
+
+    @JvmName("quoteReply-sCZ5gAI")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public infix fun MessageSelectionTimeoutChecker.quoteReply00(message: String) {
+        return reply(message)
+    }
+
+    @JvmName("quoteReply-sCZ5gAI")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public infix fun MessageSelectionTimeoutChecker.quoteReply000(message: String): Void? {
+        reply(message)
+        return null
+    }
+
+    @JvmName("quoteReply-AVDwu3U")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public infix fun MessageSelectionTimeoutChecker.quoteReply00(message: Message) {
+        return reply(message)
+    }
+
+    @JvmName("quoteReply-AVDwu3U")
+    @Deprecated("For binary compatibility", level = DeprecationLevel.HIDDEN)
+    public infix fun MessageSelectionTimeoutChecker.quoteReply000(message: Message): Void? {
+        reply(message)
+        return null
+    }
+
     protected abstract fun obtainCurrentCoroutineScope(): CoroutineScope
     protected abstract fun obtainCurrentDeferred(): CompletableDeferred<R>?
 }

+ 3 - 2
mirai-core/src/commonTest/kotlin/PlatformUtilsTest.kt

@@ -1,12 +1,13 @@
 /*
- * Copyright 2019-2020 Mamoe Technologies and contributors.
+ * Copyright 2019-2021 Mamoe Technologies and contributors.
  *
  *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
  *  https://github.com/mamoe/mirai/blob/master/LICENSE
  */
-package net.mamoe.mirai.internal.utils
+
+package net.mamoe.mirai.internal
 
 import kotlinx.io.core.toByteArray
 import net.mamoe.mirai.utils.*

+ 2 - 1
mirai-core/src/commonTest/kotlin/ScheduledJobTest.kt

@@ -6,12 +6,13 @@
  *
  *  https://github.com/mamoe/mirai/blob/master/LICENSE
  */
-package net.mamoe.mirai.internal.utils
+package net.mamoe.mirai.internal
 
 import kotlinx.coroutines.CoroutineExceptionHandler
 import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.delay
 import kotlinx.coroutines.runBlocking
+import net.mamoe.mirai.internal.utils.ScheduledJob
 import org.junit.jupiter.api.Test
 import java.util.concurrent.atomic.AtomicInteger
 import kotlin.test.assertEquals

+ 3 - 2
mirai-core/src/commonTest/kotlin/TypeConversionTest.kt

@@ -1,12 +1,13 @@
 /*
- * Copyright 2019-2020 Mamoe Technologies and contributors.
+ * Copyright 2019-2021 Mamoe Technologies and contributors.
  *
  *  此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  *  Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  *
  *  https://github.com/mamoe/mirai/blob/master/LICENSE
  */
-package net.mamoe.mirai.internal.utils
+
+package net.mamoe.mirai.internal
 
 import net.mamoe.mirai.utils.hexToBytes
 import net.mamoe.mirai.utils.toByteArray