From 48021adf18b6b496f8f45baaf55852f88ab674f4 Mon Sep 17 00:00:00 2001 From: Him188 Date: Thu, 19 Nov 2020 08:56:32 +0800 Subject: [PATCH] Add AutoLoginCommand.list --- .../src/command/BuiltInCommands.kt | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/backend/mirai-console/src/command/BuiltInCommands.kt b/backend/mirai-console/src/command/BuiltInCommands.kt index f82c47346..e0d5478d9 100644 --- a/backend/mirai-console/src/command/BuiltInCommands.kt +++ b/backend/mirai-console/src/command/BuiltInCommands.kt @@ -228,6 +228,30 @@ public object BuiltInCommands { ConfigurationKey::class with ConfigurationKey.Parser } ), BuiltInCommandInternal { + @Description("查看自动登录账号列表") + @SubCommand + public suspend fun CommandSender.list() { + sendMessage(buildString { + for (account in AutoLoginConfig.accounts) { + if (account.account == "123456") continue + append("- ") + append("账号: ") + append(account.account) + appendLine() + append(" 密码: ") + append(account.password.value) + appendLine() + + if (account.configuration.isNotEmpty()) { + appendLine(" 配置:") + for ((key, value) in account.configuration) { + append(" $key = $value") + } + appendLine() + } + } + }) + } @Description("添加自动登录") @SubCommand