fix(onebot): clarify set_msg_emoji_like error wording

Distinguish "message not found" from "private chats don't support
emoji reactions". The latter previously masqueraded as "not a group
message", which sounded like a missing feature; clarify that the
limitation is on QQ's side, not ours.
This commit is contained in:
DrSmoothl committed 2026-05-14 21:32:49 +08:00
1 parent a7fecf2a53
commit 2e4dd9b01e
1 file changed
+5 -1
+5 -1
View File
@@ -174,7 +174,11 @@ export function buildApiContext(ref: OneBotInstanceContext): ApiActionContext {
getGroupFileCount: (groupId) => bridge.fetchGroupFileCount(groupId),
setMsgEmojiLike: async (messageId, emojiId, set) => {
const meta = messageStore.findMeta(messageId);
if (!meta || !meta.isGroup) throw new Error('message not found or not a group message');
if (!meta) throw new Error('message not found');
// QQ itself doesn't expose emoji reactions on private chats, so
// there is no wire path to forward this to; fail loudly instead
// of silently no-op'ing.
if (!meta.isGroup) throw new Error('emoji reactions are not supported on private messages');
await bridge.setGroupReaction(meta.targetId, meta.sequence, emojiId, set);
},
markGroupMsgAsRead: (groupId, sequence) => bridge.markGroupMsgAsRead(groupId, sequence),