feat(qzone): add QQ space message deletion functionality (#1978)
- Add deleteQzoneMsg API method to NTQQWebApi for deleting Qzone posts by tid - Implement buildQzoneDeleteBody to construct form-encoded request payload - Implement parseQzoneDeleteResponse to validate deletion API response - Add QzoneDeleteResponse and QzoneDeleteParams type definitions - Create DeleteQzoneMsg OneBot action handler with payload validation - Register delete_qzone_msg action in router and action handlers - Add example payload and response for DeleteQzoneMsg action - Add comprehensive unit tests for delete body construction and response parsing - Fix indentation inconsistency in createAlbumCommentRequest call
This commit is contained in:
1 parent
cbec362ed1
commit
33ee94ab0f
7 files changed
+121
-4
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { OneBotAction } from '@/napcat-onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/napcat-onebot/action/router';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { ExtendsActionsExamples } from '../example/ExtendsActionsExamples';
|
||||
|
||||
const PayloadSchema = Type.Object({
|
||||
tid: Type.String({ description: '说说 tid (来自 get_qzone_msg_list / send_qzone_msg)' }),
|
||||
});
|
||||
|
||||
type PayloadType = Static<typeof PayloadSchema>;
|
||||
|
||||
export class DeleteQzoneMsg extends OneBotAction<PayloadType, void> {
|
||||
override actionName = ActionName.DeleteQzoneMsg;
|
||||
override actionSummary = '删除QQ空间说说';
|
||||
override actionDescription = '删除QQ空间(Qzone)的一条说说, 按 tid 删除';
|
||||
override actionTags = ['扩展接口'];
|
||||
override payloadExample = ExtendsActionsExamples.DeleteQzoneMsg.payload;
|
||||
override returnExample = ExtendsActionsExamples.DeleteQzoneMsg.response;
|
||||
|
||||
override payloadSchema = PayloadSchema;
|
||||
override returnSchema = Type.Null();
|
||||
|
||||
async _handle (payload: PayloadType): Promise<void> {
|
||||
await this.core.apis.WebApi.deleteQzoneMsg(payload.tid);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user