Skip to content

Commit

Permalink
修复服务器列表无法使用-p
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyv404 committed Jul 25, 2024
1 parent 13173a4 commit dcd909e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.xiaoyv404.mirai.app.minecraftServer

import com.xiaoyv404.mirai.app.fsh.IFshApp
import com.xiaoyv404.mirai.app.fsh.NfOptions
import com.xiaoyv404.mirai.core.App
import com.xiaoyv404.mirai.core.MessageProcessor.reply
import com.xiaoyv404.mirai.core.NfApp
Expand All @@ -24,12 +25,12 @@ class MinecraftServerList : NfApp(), IFshApp {
"-服务器列表"
)

private val options = Options().apply {
override fun getOptions(): Options = NfOptions().apply {
addOption("p", "player", false, "获取玩家列表")
}

override suspend fun executeRsh(args: Array<String>, msg: MessageEvent): Boolean {
val cmdLine = IFshApp.cmdLine(options, args)
val cmdLine = IFshApp.cmdLine(getOptions(), args)

val list = MinecraftServer().toList().filter { !it.hilde }
val img = MinecraftServerListGenerator().drawList(list)
Expand Down

0 comments on commit dcd909e

Please sign in to comment.