From 34f1936c6d2ff3faee1fd31ce9c8f60e43075bc6 Mon Sep 17 00:00:00 2001 From: Him188 Date: Sun, 12 Jan 2020 00:58:54 +0800 Subject: [PATCH] Fix build --- mirai-japt/src/test/kotlin/TestBlocking.kt | 31 ---------------------- 1 file changed, 31 deletions(-) delete mode 100644 mirai-japt/src/test/kotlin/TestBlocking.kt diff --git a/mirai-japt/src/test/kotlin/TestBlocking.kt b/mirai-japt/src/test/kotlin/TestBlocking.kt deleted file mode 100644 index 01393988a..000000000 --- a/mirai-japt/src/test/kotlin/TestBlocking.kt +++ /dev/null @@ -1,31 +0,0 @@ -import net.mamoe.mirai.Bot -import net.mamoe.mirai.BotAccount -import net.mamoe.mirai.japt.BlockingContacts -import net.mamoe.mirai.network.protocol.tim.packet.login.LoginResult -import java.io.File - -@ExperimentalUnsignedTypes -private fun readTestAccount(): BotAccount? { - val file = File("testAccount.txt") - if (!file.exists() || !file.canRead()) { - return null - } - - val lines = file.readLines() - return try { - BotAccount(lines[0].toUInt(), lines[1]) - } catch (e: Exception) { - null - } -} - -@ExperimentalUnsignedTypes -suspend fun main() { - val bot = Bot(readTestAccount()!!) - if (bot.network.login() != LoginResult.SUCCESS) { - throw IllegalStateException("Login failed") - } - - val createBlocking = BlockingContacts.createBlocking(bot.contacts.getQQ(123L)) - println(createBlocking.queryRemark()) -} \ No newline at end of file