refactor: action param handle

This commit is contained in:
手瓜一十雪 committed 2024-08-26 14:30:11 +08:00
1 parent 17cbe74fa3
commit f180687ba3
6 files changed
+10 -20

No files matched your search

+2 -2
View File
@@ -7,7 +7,7 @@ const SchemaData = {
type: 'object',
properties: {
group_id: { type: ['number', 'string'] },
pages: { type: 'number' },
pages: { type: ['number', 'string'] },
},
required: ['group_id'],
} as const satisfies JSONSchema;
@@ -20,7 +20,7 @@ export class GetGroupEssence extends BaseAction<Payload, GroupEssenceMsgRet> {
async _handle(payload: Payload) {
const NTQQWebApi = this.core.apis.WebApi;
const ret = await NTQQWebApi.getGroupEssenceMsg(payload.group_id.toString(), (payload.pages || "0").toString());
const ret = await NTQQWebApi.getGroupEssenceMsg(payload.group_id.toString(), (+(payload.pages ?? 0)).toString());
if (!ret) {
throw new Error('获取失败');
}