From c8c9f9ada52c57c43b3adb190783a5074297e466 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Mar 2026 13:47:33 +0000 Subject: [PATCH] Add WebSocketBot as external MCCScript bot with string enum serialization (#2805) Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/c762752f-46be-44f6-a05d-8c5effc8ef43 --- MinecraftClient/config/ChatBots/WebSocketBot.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MinecraftClient/config/ChatBots/WebSocketBot.cs b/MinecraftClient/config/ChatBots/WebSocketBot.cs index 5b8617c4..a1111b77 100644 --- a/MinecraftClient/config/ChatBots/WebSocketBot.cs +++ b/MinecraftClient/config/ChatBots/WebSocketBot.cs @@ -285,8 +285,6 @@ public class WebSocketBot : ChatBot text = GetVerbatim(text); string message = "", username = ""; - BroadcastEvent("OnChatRaw", SerializeData(new { text })); - if (IsPrivateMessage(text, ref message, ref username)) BroadcastEvent("OnChatPrivate", SerializeData(new { sender = username, message, rawText = text })); else if (IsChatMessage(text, ref message, ref username)) @@ -297,6 +295,11 @@ public class WebSocketBot : ChatBot BroadcastEvent("OnTeleportRequest", SerializeData(new { sender = tpSender, rawText = text })); } + public override void GetText(string text, string? json) + { + BroadcastEvent("OnChatRaw", SerializeData(new { text, json })); + } + public override bool OnDisconnect(DisconnectReason reason, string message) { BroadcastEvent("OnDisconnect", SerializeData(new { reason = reason.ToString(), message }));