From 25928382613b383ac15b5e50d103b2c9a88212e2 Mon Sep 17 00:00:00 2001 From: RTAkland Date: Sat, 14 Dec 2024 15:59:41 +0800 Subject: [PATCH] chore: use super class method --- .../cn/rtast/rob/command/BrigadierCommandManager.kt | 9 ++++++++- .../cn/rtast/rob/util/BrigadierCommandManagerImpl.kt | 8 -------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ronebot-common/src/main/kotlin/cn/rtast/rob/command/BrigadierCommandManager.kt b/ronebot-common/src/main/kotlin/cn/rtast/rob/command/BrigadierCommandManager.kt index 68371ec..f366fb6 100644 --- a/ronebot-common/src/main/kotlin/cn/rtast/rob/command/BrigadierCommandManager.kt +++ b/ronebot-common/src/main/kotlin/cn/rtast/rob/command/BrigadierCommandManager.kt @@ -31,5 +31,12 @@ interface BrigadierCommandManager { /** * 执行命令 */ - fun execute(command: String) + fun execute(command: String) { + try { + botInstances.forEach { + dispatcher.execute(command, it) + } + } catch (_: Exception) { + } + } } \ No newline at end of file diff --git a/ronebot-onebot-v11/src/main/kotlin/cn/rtast/rob/util/BrigadierCommandManagerImpl.kt b/ronebot-onebot-v11/src/main/kotlin/cn/rtast/rob/util/BrigadierCommandManagerImpl.kt index 8d41ac5..db16110 100644 --- a/ronebot-onebot-v11/src/main/kotlin/cn/rtast/rob/util/BrigadierCommandManagerImpl.kt +++ b/ronebot-onebot-v11/src/main/kotlin/cn/rtast/rob/util/BrigadierCommandManagerImpl.kt @@ -16,12 +16,4 @@ class BrigadierCommandManagerImpl internal constructor( ) : BrigadierCommandManager { override val dispatcher = CommandDispatcher() - override fun execute(command: String) { - try { - botInstances.forEach { - dispatcher.execute(command, it) - } - } catch (_: Exception) { - } - } } \ No newline at end of file