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<LoginResult> + // 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<LoginResult> + + // endregion + fun close() } \ No newline at end of file