mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
修改 OkWsBot.cs,获取玩家列表时排除自己
删除群号指定,因为在py-server.py里已经指定
This commit is contained in:
parent
9ae3bc4d0d
commit
725510d3ef
1 changed files with 5 additions and 4 deletions
|
|
@ -24,12 +24,12 @@ public class OkWsBot : ChatBot
|
||||||
public class Configs {
|
public class Configs {
|
||||||
public bool Enabled = true;
|
public bool Enabled = true;
|
||||||
|
|
||||||
[TomlInlineComment("群号")]
|
|
||||||
public string id = "12345678";
|
|
||||||
[TomlInlineComment("Python Websocket接口")]
|
[TomlInlineComment("Python Websocket接口")]
|
||||||
public string pythonSendWsApi = "ws://127.0.0.1:12345";
|
public string pythonSendWsApi = "ws://127.0.0.1:12345";
|
||||||
[TomlInlineComment("在群内显示的服务器名称")]
|
[TomlInlineComment("在群内显示的服务器名称")]
|
||||||
public string serverName = "1.20";
|
public string serverName = "1.20";
|
||||||
|
[TomlInlineComment("在群内昵称")]
|
||||||
|
public string groupCard = "QQbot";
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
|
|
@ -102,8 +102,9 @@ public class OkWsBot : ChatBot
|
||||||
|
|
||||||
public string GetPlayerListMsg() {
|
public string GetPlayerListMsg() {
|
||||||
string result = "["+Config.serverName+"]";
|
string result = "["+Config.serverName+"]";
|
||||||
string[] playerStrs = GetOnlinePlayers();
|
List<string> playerStrs = new List<string>(GetOnlinePlayers());
|
||||||
if (playerStrs.Length == 0) {
|
playerStrs.Remove(Config.groupCard);
|
||||||
|
if (playerStrs.Count == 0) {
|
||||||
return result += " [鬼服]\n没有玩家在线";
|
return result += " [鬼服]\n没有玩家在线";
|
||||||
}
|
}
|
||||||
result += " 在线玩家:";
|
result += " 在线玩家:";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue