feat(qzone): delete_qzone_msg — delete a 说说 by tid via web API

deleteQzoneMsg POSTs a form-urlencoded tid to taotao.qzone.qq.com's
emotion_cgi_delete_v6 (proxied through h5.qzone), on the bot's own space.
Success has no positive payload beyond code 0, so the contract is
throw-on-non-zero-code (foreign/unknown tid or auth failure); the server
only deletes feeds the hostUin owns. Rejects empty tid pre-flight.

- core: QzoneApi.delete; onebot: delete_qzone_msg action; regen catalog.
- tests: tid form-body/url/headers lock, empty-tid preflight, non-zero
  code throw, and bridge self-space threading.
This commit is contained in:
DrSmoothl committed 2026-06-20 01:47:50 +08:00
1 parent 9e21c3a7ef
commit a704f12945
6 files changed
+159 -2

No files matched your search

+18
View File
@@ -67,6 +67,24 @@ export const actions = [
}
},
}),
// delete_qzone_msg — 删除机器人自己空间的一条说说(按 tid)。写操作。
defineAction({
name: 'delete_qzone_msg',
summary: '删除一条说说(QQ 空间,按 tid)',
params: {
tid: f.string({ allowEmpty: false }).describe('说说 tid(来自 get_qzone_msg_list / send_qzone_msg)'),
},
run: async (p, ctx) => {
try {
await ctx.bridge.apis.qzone.delete(p.tid);
return okResponse(null);
} catch (error) {
const message = error instanceof Error ? error.message : 'failed to delete qzone msg';
return failedResponse(RETCODE.INTERNAL_ERROR, message);
}
},
}),
];
export function register(h: ApiHandler, ctx: ApiActionContext): void {