From 725510d3ef084cc33492f72a5dce0a4b29f97c3a Mon Sep 17 00:00:00 2001 From: oldkingOK Date: Fri, 12 Jan 2024 13:25:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20OkWsBot.cs=EF=BC=8C?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=8E=A9=E5=AE=B6=E5=88=97=E8=A1=A8=E6=97=B6?= =?UTF-8?q?=E6=8E=92=E9=99=A4=E8=87=AA=E5=B7=B1=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=BE=A4=E5=8F=B7=E6=8C=87=E5=AE=9A=EF=BC=8C=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E5=9C=A8py-server.py=E9=87=8C=E5=B7=B2=E7=BB=8F=E6=8C=87?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MinecraftClient/ChatBots/OkWsBot.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MinecraftClient/ChatBots/OkWsBot.cs b/MinecraftClient/ChatBots/OkWsBot.cs index 431c3fcd..1e65ab0a 100644 --- a/MinecraftClient/ChatBots/OkWsBot.cs +++ b/MinecraftClient/ChatBots/OkWsBot.cs @@ -24,12 +24,12 @@ public class OkWsBot : ChatBot public class Configs { public bool Enabled = true; - [TomlInlineComment("群号")] - public string id = "12345678"; [TomlInlineComment("Python Websocket接口")] public string pythonSendWsApi = "ws://127.0.0.1:12345"; [TomlInlineComment("在群内显示的服务器名称")] public string serverName = "1.20"; + [TomlInlineComment("在群内昵称")] + public string groupCard = "QQbot"; } public override void Initialize() @@ -102,8 +102,9 @@ public class OkWsBot : ChatBot public string GetPlayerListMsg() { string result = "["+Config.serverName+"]"; - string[] playerStrs = GetOnlinePlayers(); - if (playerStrs.Length == 0) { + List playerStrs = new List(GetOnlinePlayers()); + playerStrs.Remove(Config.groupCard); + if (playerStrs.Count == 0) { return result += " [鬼服]\n没有玩家在线"; } result += " 在线玩家:";