Skip to content

Commit

Permalink
chore: use super class method
Browse files Browse the repository at this point in the history
  • Loading branch information
RTAkland committed Dec 14, 2024
1 parent a38c53a commit 2592838
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,12 @@ interface BrigadierCommandManager<B : BaseBotInstance> {
/**
* 执行命令
*/
fun execute(command: String)
fun execute(command: String) {
try {
botInstances.forEach {
dispatcher.execute(command, it)
}
} catch (_: Exception) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,4 @@ class BrigadierCommandManagerImpl internal constructor(
) : BrigadierCommandManager<BotInstance> {

override val dispatcher = CommandDispatcher<BotInstance>()
override fun execute(command: String) {
try {
botInstances.forEach {
dispatcher.execute(command, it)
}
} catch (_: Exception) {
}
}
}

0 comments on commit 2592838

Please sign in to comment.