feat(qzone): add complete feed lookup by tid

Refs #633
This commit is contained in:
DrSmoothl committed 2026-11-01 21:31:52 +08:00
1 parent f79187f36a
commit c15ecd0402
18 files changed
+547 -13

No files matched your search

+11 -1
View File
@@ -185,7 +185,17 @@ for (const comment of detail.comments) {
`get_qzone_home_feeds` 读取自己的空间主页,可传 `target_uin` 访问有权限的其他主页;`cursor` 使用同一账号、同一主页上次返回的 `next_cursor`。它返回完整动态,旧版 `get_qzone_feeds` 和 `get_qzone_msg_list` 保持原有格式。
把主页或推荐列表的完整动态传给 `get_qzone_share_ark`,可获得 `{ ark, requires_confirmation, notice }`。此动作会生成分享卡片但不发送消息;将 `ark` 原文交给普通 JSON 消息发送接口即可获得消息编号,继续使用已有撤回及发送事件能力。
已有说说编号时,可调用 `get_qzone_feed_detail`,传入 `get_qzone_msg_list` 或 `send_qzone_msg` 返回的 24 位十六进制 `tid`。此接口读取普通空间说说,自动从编号取得作者和发布时间,不需要 `target_uin`;访问仍使用当前账号的权限。结果的 `feed` 是单个完整动态对象,保留图片、视频、分享信息和未知字段,无需再取 `.feed.feed`。其余上游详情字段也会保留,`attach_info` 为上游评论游标(未提供时为 `null`);只读取一次详情,不自动翻页,也不保证评论和回复完整。旧的 `get_qzone_msg_detail` 及其 `pos/num` 分页保持不变。
```ts
const detail = await bot.raw('get_qzone_feed_detail', {
tid: '1127000000f1536501000000', // 替换为实际说说编号
});
const card = await bot.raw('get_qzone_share_ark', { feed: detail.feed });
// 若 card.requires_confirmation 为 true,发送前展示 card.notice 并取得确认。
```
把详情、主页或推荐列表的完整动态传给 `get_qzone_share_ark`,可获得 `{ ark, requires_confirmation, notice }`。此动作会生成分享卡片但不发送消息;将 `ark` 原文交给普通 JSON 消息发送接口即可获得消息编号,继续使用已有撤回及发送事件能力。能读取不代表允许分享:分享受限或缺少上游分享信息时,分享接口会明确报错。
分享链接可能让未登录者也能访问动态,并包含作者 QQ 号。若 `requires_confirmation` 为 `true`,发送前应展示 `notice` 并取得确认;上游禁止分享或生成失败会返回错误。
+1
View File
@@ -185,6 +185,7 @@ export const SNOWLUMA_ACTIONS = [
'get_qun_album_list',
'get_qzone_feeds',
'get_qzone_home_feeds',
'get_qzone_feed_detail',
'get_qzone_msg_detail',
'get_qzone_msg_list',
'get_qzone_profile',
+3
View File
@@ -104,6 +104,7 @@ import type {
GetQzoneProfileParams,
GetQzonePublicFeedsParams,
GetQzoneHomeFeedsParams,
GetQzoneFeedDetailParams,
GetQzoneShareArkParams,
GetQzonePublicCommentsParams,
GetQzonePublicRepliesParams,
@@ -205,6 +206,7 @@ import type {
QzonePublishResult,
QzoneProfileResult,
QzonePublicFeedsPage,
QzoneFeedDetailResult,
QzoneShareArkResult,
QzoneUpdateRightResult,
RkeyServerResult,
@@ -428,6 +430,7 @@ export interface SnowLumaActionMap {
get_qzone_public_capabilities: { params: JsonObject; data: JsonObject };
get_qzone_public_feeds: { params: GetQzonePublicFeedsParams; data: QzonePublicFeedsPage };
get_qzone_home_feeds: { params: GetQzoneHomeFeedsParams; data: QzonePublicFeedsPage };
get_qzone_feed_detail: { params: GetQzoneFeedDetailParams; data: QzoneFeedDetailResult };
get_qzone_share_ark: { params: GetQzoneShareArkParams; data: QzoneShareArkResult };
get_qzone_public_feed_detail: { params: QzonePublicFeedParams; data: JsonObject };
get_qzone_public_comments: { params: GetQzonePublicCommentsParams; data: JsonObject };
+6 -1
View File
@@ -633,8 +633,13 @@ export interface GetQzoneHomeFeedsParams extends JsonObject {
cursor?: string;
}
export interface GetQzoneFeedDetailParams extends JsonObject {
/** 24 hexadecimal characters from get_qzone_msg_list or send_qzone_msg. */
tid: string;
}
export interface GetQzoneShareArkParams extends JsonObject {
/** Original feed from get_qzone_home_feeds or get_qzone_public_feeds. */
/** Original feed from get_qzone_feed_detail, get_qzone_home_feeds or get_qzone_public_feeds. */
feed: JsonObject;
}
+7
View File
@@ -422,6 +422,13 @@ export interface QzonePublicFeedsPage extends JsonObject {
next_cursor: string | null;
}
export interface QzoneFeedDetailResult extends JsonObject {
/** Original cells, suitable for get_qzone_share_ark when sharing is permitted. */
feed: JsonObject;
/** Upstream comment continuation; null when none is supplied. No automatic pagination. */
attach_info: string | null;
}
export interface QzoneShareArkResult extends JsonObject {
/** Preserve this string when sending a JSON message. */
ark: string;
+9
View File
@@ -97,6 +97,7 @@ export const actionParams = {
get_qzone_profile: { target_uin: '10002' },
get_qzone_public_capabilities: {},
get_qzone_home_feeds: { target_uin: '10001', cursor: 'home-feed-cursor' },
get_qzone_feed_detail: { tid: '1127000000f1536501000000' },
get_qzone_share_ark: { feed: qzonePublicFeed },
get_qzone_public_comments: { feed: qzonePublicFeed, cursor: 'comments-from-detail' },
get_qzone_public_feed_detail: { feed: qzonePublicFeed },
@@ -232,6 +233,7 @@ export type CoveredAction =
| 'get_qzone_profile'
| 'get_qzone_public_capabilities'
| 'get_qzone_home_feeds'
| 'get_qzone_feed_detail'
| 'get_qzone_share_ark'
| 'get_qzone_public_comments'
| 'get_qzone_public_feed_detail'
@@ -469,6 +471,13 @@ export const actionResults = {
get_qzone_profile: { name: 'Space', description: 'Description' },
get_qzone_public_capabilities: { public_qzone_entrance_switch: true, can_upvote: true },
get_qzone_home_feeds: { feeds: [qzonePublicFeed], has_more: false, next_cursor: null },
get_qzone_feed_detail: {
feed: {
cell_common: { domain_type: 1, union_id: { feed_id: '1127000000f1536501000000' } },
cell_pic: { future_image_field: true },
},
attach_info: 'comments-from-detail',
},
get_qzone_share_ark: { ark: '{"app":"com.tencent.tuwen.lua"}', requires_confirmation: false, notice: null },
get_qzone_public_comments: {
cell_comment: { comments: [qzonePublicComment] },
+9
View File
@@ -164,6 +164,15 @@ export const invalidQzoneProfilePatch: ActionParams<'set_qzone_profile'> = {
// @ts-expect-error profile fields accept string, number or boolean primitives
description: [],
};
const feedDetail = await http.raw('get_qzone_feed_detail', actionParams.get_qzone_feed_detail);
export const fullQzoneFeed: JsonObject = feedDetail.feed;
export const feedDetailCursor: string | null = feedDetail.attach_info;
export const feedDetailCard = await http.raw('get_qzone_share_ark', { feed: feedDetail.feed });
// @ts-expect-error querying a feed requires a post ID
http.raw('get_qzone_feed_detail', {});
// @ts-expect-error the post ID is hexadecimal text, not an array
http.raw('get_qzone_feed_detail', { tid: [] });
const publicPage = await http.raw('get_qzone_public_feeds', {});
export const publicCells: JsonObject[] = publicPage.feeds;
export const publicHasMore: boolean = publicPage.has_more;