From 2223451b7089051bfce20b29a0efc4a099f4690c Mon Sep 17 00:00:00 2001 From: Him188 Date: Fri, 11 Sep 2020 23:08:15 +0800 Subject: [PATCH] Ignore blank inputs --- .../main/kotlin/net/mamoe/mirai/console/pure/ConsoleThread.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/mirai-console-pure/src/main/kotlin/net/mamoe/mirai/console/pure/ConsoleThread.kt b/frontend/mirai-console-pure/src/main/kotlin/net/mamoe/mirai/console/pure/ConsoleThread.kt index 80751f6cd..dd1bd9133 100644 --- a/frontend/mirai-console-pure/src/main/kotlin/net/mamoe/mirai/console/pure/ConsoleThread.kt +++ b/frontend/mirai-console-pure/src/main/kotlin/net/mamoe/mirai/console/pure/ConsoleThread.kt @@ -34,6 +34,7 @@ internal fun startupConsoleThread() { try { val next = MiraiConsole.requestInput("").let { when { + it.isBlank() -> it it.startsWith(CommandManager.commandPrefix) -> it it == "?" -> CommandManager.commandPrefix + BuiltInCommands.HelpCommand.primaryName else -> CommandManager.commandPrefix + it