diff --git a/mirai-core-qqandroid/src/androidMain/kotlin/net/mamoe/mirai/qqandroid/QQAndroid.kt b/mirai-core-qqandroid/src/androidMain/kotlin/net/mamoe/mirai/qqandroid/QQAndroid.kt index e99af5874..91bbc6dbf 100644 --- a/mirai-core-qqandroid/src/androidMain/kotlin/net/mamoe/mirai/qqandroid/QQAndroid.kt +++ b/mirai-core-qqandroid/src/androidMain/kotlin/net/mamoe/mirai/qqandroid/QQAndroid.kt @@ -19,8 +19,10 @@ import net.mamoe.mirai.utils.MiraiInternalAPI /** * QQ for Android */ +@Suppress("INAPPLICABLE_JVM_NAME") actual object QQAndroid : BotFactory { @UseExperimental(MiraiInternalAPI::class) + @JvmName("newBot") actual override fun Bot(context: Context, qq: Long, password: String, configuration: BotConfiguration): Bot { return QQAndroidBot(context, BotAccount(qq, password), configuration) } @@ -29,6 +31,7 @@ actual object QQAndroid : BotFactory { * 使用指定的 [配置][configuration] 构造 [Bot] 实例 */ @UseExperimental(MiraiInternalAPI::class) + @JvmName("newBot") actual override fun Bot( context: Context, qq: Long, diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/BotFactory.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/BotFactory.kt index d44d9c945..63dfe6935 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/BotFactory.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/BotFactory.kt @@ -14,20 +14,24 @@ import net.mamoe.mirai.BotFactory import net.mamoe.mirai.qqandroid.QQAndroid.Bot import net.mamoe.mirai.utils.BotConfiguration import net.mamoe.mirai.utils.Context +import kotlin.jvm.JvmName /** * QQ for Android */ +@Suppress("INAPPLICABLE_JVM_NAME") expect object QQAndroid : BotFactory { /** * 使用指定的 [配置][configuration] 构造 [Bot] 实例 */ + @JvmName("newBot") override fun Bot(context: Context, qq: Long, password: String, configuration: BotConfiguration): Bot /** * 使用指定的 [配置][configuration] 构造 [Bot] 实例 */ + @JvmName("newBot") override fun Bot( context: Context, qq: Long, diff --git a/mirai-core-qqandroid/src/jvmMain/kotlin/net/mamoe/mirai/qqandroid/QQAndroid.kt b/mirai-core-qqandroid/src/jvmMain/kotlin/net/mamoe/mirai/qqandroid/QQAndroid.kt index 93d5bd702..ff08d4d16 100644 --- a/mirai-core-qqandroid/src/jvmMain/kotlin/net/mamoe/mirai/qqandroid/QQAndroid.kt +++ b/mirai-core-qqandroid/src/jvmMain/kotlin/net/mamoe/mirai/qqandroid/QQAndroid.kt @@ -22,12 +22,14 @@ import net.mamoe.mirai.utils.MiraiInternalAPI /** * QQ for Android */ +@Suppress("INAPPLICABLE_JVM_NAME") @UseExperimental(MiraiInternalAPI::class) actual object QQAndroid : BotFactory { /** * 使用指定的 [配置][configuration] 构造 [Bot] 实例 */ + @JvmName("newBot") actual override fun Bot(context: Context, qq: Long, password: String, configuration: BotConfiguration): Bot { return QQAndroidBot(context, BotAccount(qq, password), configuration) } @@ -35,12 +37,14 @@ actual object QQAndroid : BotFactory { /** * 使用指定的 [配置][configuration] 构造 [Bot] 实例 */ + @JvmName("newBot") fun Bot(qq: Long, password: String, configuration: BotConfiguration = BotConfiguration.Default): Bot = QQAndroidBot(BotAccount(qq, password), configuration) /** * 使用指定的 [配置][configuration] 构造 [Bot] 实例 */ + @JvmName("newBot") actual override fun Bot( context: Context, qq: Long, @@ -51,6 +55,7 @@ actual object QQAndroid : BotFactory { /** * 使用指定的 [配置][configuration] 构造 [Bot] 实例 */ + @JvmName("newBot") fun Bot( qq: Long, passwordMd5: ByteArray, diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/BotFactory.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/BotFactory.kt index 34f2ee64b..b6250961a 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/BotFactory.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/BotFactory.kt @@ -13,6 +13,7 @@ package net.mamoe.mirai import net.mamoe.mirai.utils.BotConfiguration import net.mamoe.mirai.utils.Context +import kotlin.jvm.JvmName /** * 构造 [Bot] 的工厂. @@ -21,10 +22,12 @@ import net.mamoe.mirai.utils.Context * - `mirai-core-timpc`: `TIMPC` * - `mirai-core-qqandroid`: `QQAndroid` */ +@Suppress("INAPPLICABLE_JVM_NAME") interface BotFactory { /** * 使用指定的 [配置][configuration] 构造 [Bot] 实例 */ + @JvmName("newBot") fun Bot( context: Context, qq: Long, @@ -35,6 +38,7 @@ interface BotFactory { /** * 使用指定的 [配置][configuration] 构造 [Bot] 实例 */ + @JvmName("newBot") fun Bot( context: Context, qq: Long,