26 包 monorepo(TS 全源码): - snowcat-core: NT 内核 API 封装 + listener(含 9.9.37 六回调适配)+ Packet 发包 - snowcat-onebot: OneBot v11 全动作 + MCP Streamable HTTP 适配器 + 稳定线 - snowcat-webui-frontend/backend: 雪猫控制台(React+HeroUI) - snowcat-shell: 单文件 bundle 出口(vite inlineDynamicImports) - snowcat-native: napi2native / MoeHoo / ffmpeg / pty 运行时 - 56 项 SnowLuma 独门动作移植(qzone 全家桶/群相册/装扮/闪照/收藏) - 工具件: 解包器/启动器/便携制作器/doctor GitHub 关联已全量指向 DandanLLab/SnowCatQQ
43 lines
1.6 KiB
TypeScript
43 lines
1.6 KiB
TypeScript
import { OneBotAction } from '@/snowcat-onebot/action/OneBotAction';
|
|
import { ActionName } from '@/snowcat-onebot/action/router';
|
|
import { Static, Type } from '@sinclair/typebox';
|
|
|
|
const PayloadSchema = Type.Object({
|
|
target_uin: Type.String({ description: '说说主人的QQ号' }),
|
|
tid: Type.String({ description: '说说tid' }),
|
|
pos: Type.Optional(Type.Union([Type.Number(), Type.String()], { default: 0, description: '评论起始偏移' })),
|
|
num: Type.Optional(Type.Union([Type.Number(), Type.String()], { default: 20, description: '评论每页数量' })),
|
|
});
|
|
|
|
type PayloadType = Static<typeof PayloadSchema>;
|
|
|
|
export class GetQzoneMsgDetail extends OneBotAction<PayloadType, unknown> {
|
|
override actionName = ActionName.GetQzoneMsgDetail;
|
|
override actionSummary = '获取说说详情';
|
|
override actionDescription = '读取一条说说正文与一页评论(含内联回复)';
|
|
override actionTags = ['扩展接口'];
|
|
override payloadExample = { target_uin: '123456789', tid: 'abc123' };
|
|
override returnExample = {
|
|
tid: 'abc123',
|
|
content: '正文',
|
|
comment_num: 2,
|
|
comments: [],
|
|
};
|
|
override payloadSchema = PayloadSchema;
|
|
override returnSchema = Type.Object({
|
|
tid: Type.String(),
|
|
content: Type.String(),
|
|
comment_num: Type.Number(),
|
|
comments: Type.Array(Type.Any()),
|
|
});
|
|
|
|
async _handle (payload: PayloadType) {
|
|
return this.core.apis.WebApi.getQzoneMsgDetail(
|
|
payload.target_uin,
|
|
payload.tid,
|
|
payload.pos !== undefined ? +payload.pos : 0,
|
|
payload.num !== undefined ? +payload.num : 20,
|
|
);
|
|
}
|
|
}
|