BUG修复

1.尝试让所有人能收到group_admin事件
2.修复请求API: delete_msg(POST请求网址传参)将负数判定为文本导致无法调用的问题
This commit is contained in:
Alen
2024-07-22 01:22:38 +08:00
parent 73e3dfbcdd
commit cdb8d02b4d
4 changed files with 59 additions and 6 deletions

View File

@@ -7,7 +7,12 @@ import { FromSchema, JSONSchema } from 'json-schema-to-ts';
const SchemaData = {
type: 'object',
properties: {
message_id: { type: 'number' },
message_id: {
oneOf:[
{ type: 'number' },
{ type: 'string' }
]
}
},
required: ['message_id']
} as const satisfies JSONSchema;
@@ -18,7 +23,7 @@ class DeleteMsg extends BaseAction<Payload, void> {
actionName = ActionName.DeleteMsg;
PayloadSchema = SchemaData;
protected async _handle(payload: Payload) {
const msg = await dbUtil.getMsgByShortId(payload.message_id);
const msg = await dbUtil.getMsgByShortId(Number(payload.message_id));
if (msg) {
await NTQQMsgApi.recallMsg({ peerUid: msg.peerUid, chatType: msg.chatType }, [msg.msgId]);
}