fix(qqbot): support C2C DM and group messages for non-guild chat_ids - #16937
Closed
lengxii wants to merge 1 commit into
Closed
fix(qqbot): support C2C DM and group messages for non-guild chat_ids#16937lengxii wants to merge 1 commit into
lengxii wants to merge 1 commit into
Conversation
The _send_qqbot() function was hardcoded to use the guild channel API
(`/channels/{chat_id}/messages`), which fails when chat_id is a QQ
user open_id (32-char hex string) rather than a numeric guild channel ID.
This fix detects the chat_id format and routes to the correct endpoint:
- 32-char hex → C2C DM via `/v2/users/{open_id}/messages`
- 32-char hex with chat_type=group → `/v2/groups/{open_id}/messages`
- Short numeric → Guild channel via `/channels/{channel_id}/messages`
Also checks channel_directory for explicit chat_type hints.
Collaborator
|
Likely duplicate of #15215 — same fix: route QQBot sends to C2C/group REST endpoints based on chat_id format. |
Collaborator
|
Likely duplicate of #15215 |
This was referenced Apr 30, 2026
Contributor
|
Closing as superseded — |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
_send_qqbot()is hardcoded to use the guild channel API (/channels/{chat_id}/messages), which returns{"message":"频道不存在","code":11263}whenchat_idis a QQ user open_id (32-char hex string) instead of a numeric guild channel ID.Fix
Detect
chat_idformat and route to the correct QQ Bot Open Platform endpoint:/v2/users/{open_id}/messageschat_type=group/v2/groups/{open_id}/messages/channels/{channel_id}/messagesAlso checks
channel_directoryfor explicitchat_typehints.Testing
Verified locally with QQ Bot (app_id 1903058601) — message sent successfully to a C2C DM target that previously failed with "频道不存在".