diff --git a/packages/core/src/bridge/actions/interaction.ts b/packages/core/src/bridge/actions/interaction.ts index df16d73a..3a49c157 100644 --- a/packages/core/src/bridge/actions/interaction.ts +++ b/packages/core/src/bridge/actions/interaction.ts @@ -30,8 +30,13 @@ export async function sendLike(bridge: Bridge, userId: number, count: number): P export async function setGroupReaction(bridge: Bridge, groupId: number, sequence: number, code: string, isSet: boolean): Promise { const subCmd = isSet ? 1 : 2; const cmd = isSet ? 'OidbSvcTrpcTcp.0x9082_1' : 'OidbSvcTrpcTcp.0x9082_2'; + // Same heuristic NapCat uses: QQ face ids are 1–3 digits ("76"), + // unicode codepoints are longer ("128516"). Server requires the + // type field to pick the right resolution table; omitting it makes + // unicode reactions silently fail. + const type = code.length > 3 ? 2 : 1; await sendOidbAndCheck(bridge, cmd, 0x9082, subCmd, - { groupUin: groupId, sequence, code }, OidbGroupReactionSchema); + { groupUin: groupId, sequence, code, type }, OidbGroupReactionSchema); } export async function getEmojiLikes( diff --git a/packages/core/src/bridge/proto/oidb-action.ts b/packages/core/src/bridge/proto/oidb-action.ts index 59012e4b..5e4b8a78 100644 --- a/packages/core/src/bridge/proto/oidb-action.ts +++ b/packages/core/src/bridge/proto/oidb-action.ts @@ -395,6 +395,11 @@ export const OidbGroupReactionSchema = { groupUin: { field: 1, type: 'uint32' as const }, sequence: { field: 2, type: 'uint32' as const }, code: { field: 3, type: 'string' as const }, + // 1 = legacy QQ face (short numeric id like "76"), 2 = unicode emoji + // (decimal codepoint string like "128516" for 😄). Omitting this + // field used to make unicode reactions fail server-side because the + // server defaulted to type=1 and couldn't resolve a 6-digit code. + type: { field: 4, type: 'uint32' as const }, } satisfies ProtoSchema; // --- 0x6D8_1: Group file list ---