Repository: HKUDS/nanobot (python)

Issue:
qq markdown信息 破坏老版本客户端交互

应该是这个commit导致的 
https://github.com/HKUDS/nanobot/commit/1421ac501c381c253dfca156558b16d6a0f73a64

之前还可以正常兼容的

<img width="1102" height="241" alt="Image" src="https://github.com/user-attachments/assets/3fc8305d-447f-4108-99bb-74f19daec446" />

![Image](https://github.com/user-attachments/assets/8052835e-221c-4c4a-9c26-16452968b9c1)


Patch:
diff --git a/nanobot/channels/qq.py b/nanobot/channels/qq.py
index 792cc1217e..80b7500859 100644
--- a/nanobot/channels/qq.py
+++ b/nanobot/channels/qq.py
@@ -114,16 +114,16 @@ async def send(self, msg: OutboundMessage) -> None:
             if msg_type == "group":
                 await self._client.api.post_group_message(
                     group_openid=msg.chat_id,
-                    msg_type=2,
-                    markdown={"content": msg.content},
+                    msg_type=0,
+                    content=msg.content,
                     msg_id=msg_id,
                     msg_seq=self._msg_seq,
                 )
             else:
                 await self._client.api.post_c2c_message(
                     openid=msg.chat_id,
-                    msg_type=2,
-                    markdown={"content": msg.content},
+                    msg_type=0,
+                    content=msg.content,
                     msg_id=msg_id,
                     msg_seq=self._msg_seq,
                 )


Test patch:
diff --git a/tests/test_qq_channel.py b/tests/test_qq_channel.py
index 90b4e60100..db21468956 100644
--- a/tests/test_qq_channel.py
+++ b/tests/test_qq_channel.py
@@ -44,7 +44,7 @@ async def test_on_group_message_routes_to_group_chat_id() -> None:
 
 
 @pytest.mark.asyncio
-async def test_send_group_message_uses_group_api_with_msg_seq() -> None:
+async def test_send_group_message_uses_plain_text_group_api_with_msg_seq() -> None:
     channel = QQChannel(QQConfig(app_id="app", secret="secret", allow_from=["*"]), MessageBus())
     channel._client = _FakeClient()
     channel._chat_type_cache["group123"] = "group"
@@ -60,7 +60,37 @@ async def test_send_group_message_uses_group_api_with_msg_seq() -> None:
 
     assert len(channel._client.api.group_calls) == 1
     call = channel._client.api.group_calls[0]
-    assert call["group_openid"] == "group123"
-    assert call["msg_id"] == "msg1"
-    assert call["msg_seq"] == 2
+    assert call == {
+        "group_openid": "group123",
+        "msg_type": 0,
+        "content": "hello",
+        "msg_id": "msg1",
+        "msg_seq": 2,
+    }
     assert not channel._client.api.c2c_calls
+
+
+@pytest.mark.asyncio
+async def test_send_c2c_message_uses_plain_text_c2c_api_with_msg_seq() -> None:
+    channel = QQChannel(QQConfig(app_id="app", secret="secret", allow_from=["*"]), MessageBus())
+    channel._client = _FakeClient()
+
+    await channel.send(
+        OutboundMessage(
+            channel="qq",
+            chat_id="user123",
+            content="hello",
+            metadata={"message_id": "msg1"},
+        )
+    )
+
+    assert len(channel._client.api.c2c_calls) == 1
+    call = channel._client.api.c2c_calls[0]
+    assert call == {
+        "openid": "user123",
+        "msg_type": 0,
+        "content": "hello",
+        "msg_id": "msg1",
+        "msg_seq": 2,
+    }
+    assert not channel._client.api.group_calls