From c4b42a31f75a7a0dc714157f04aef25f7278e929 Mon Sep 17 00:00:00 2001 From: Him188 Date: Sat, 14 Dec 2019 23:39:57 +0800 Subject: [PATCH] Rearrange class memebrs --- .../commonMain/kotlin/net.mamoe.mirai/Bot.kt | 70 +++++++++++-------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt index 1028e5e68..d3d01e7a1 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt @@ -54,37 +54,7 @@ interface Bot : CoroutineScope { override val coroutineContext: CoroutineContext - /** - * 网络模块 - */ - val network: BotNetworkHandler<*> - - /** - * [关闭][BotNetworkHandler.close]网络处理器, 取消所有运行在 [BotNetworkHandler] 下的协程. - * 然后重新启动并尝试登录 - */ - fun tryReinitializeNetworkHandler( - configuration: BotConfiguration, - cause: Throwable? = null - ): Job - - /** - * [关闭][BotNetworkHandler.close]网络处理器, 取消所有运行在 [BotNetworkHandler] 下的协程. - * 然后重新启动并尝试登录 - */ - suspend fun reinitializeNetworkHandler( - configuration: BotConfiguration, - cause: Throwable? = null - ): LoginResult - - /** - * [关闭][BotNetworkHandler.close]网络处理器, 取消所有运行在 [BotNetworkHandler] 下的协程. - * 然后重新启动并尝试登录 - */ - fun reinitializeNetworkHandlerAsync( - configuration: BotConfiguration, - cause: Throwable? = null - ): Deferred + // region contacts /** * 与这个机器人相关的 QQ 列表. 机器人与 QQ 不一定是好友 @@ -124,5 +94,43 @@ interface Bot : CoroutineScope { */ suspend fun getGroup(id: Long): Group + // endregion + + // region network + + /** + * 网络模块 + */ + val network: BotNetworkHandler<*> + + /** + * [关闭][BotNetworkHandler.close]网络处理器, 取消所有运行在 [BotNetworkHandler] 下的协程. + * 然后重新启动并尝试登录 + */ + fun tryReinitializeNetworkHandler( + configuration: BotConfiguration, + cause: Throwable? = null + ): Job + + /** + * [关闭][BotNetworkHandler.close]网络处理器, 取消所有运行在 [BotNetworkHandler] 下的协程. + * 然后重新启动并尝试登录 + */ + suspend fun reinitializeNetworkHandler( + configuration: BotConfiguration, + cause: Throwable? = null + ): LoginResult + + /** + * [关闭][BotNetworkHandler.close]网络处理器, 取消所有运行在 [BotNetworkHandler] 下的协程. + * 然后重新启动并尝试登录 + */ + fun reinitializeNetworkHandlerAsync( + configuration: BotConfiguration, + cause: Throwable? = null + ): Deferred + + // endregion + fun close() } \ No newline at end of file