diff --git a/docs/changelogs/CHANGELOG.v1.5.2.md b/docs/changelogs/CHANGELOG.v1.5.2.md index d7f5d742..d470a1cc 100644 --- a/docs/changelogs/CHANGELOG.v1.5.2.md +++ b/docs/changelogs/CHANGELOG.v1.5.2.md @@ -5,6 +5,7 @@ QQ Version: Windows 9.9.10-24108 / Linux 3.2.7-23361 ## 修复与优化 * 替换Uid/Uin为内部实现 * 增加HttpApi调用稳定性 +* 修复 GetMsg 兼容性 ## 新增与调整 * 支持真正意义上的陌生人信息获取 Api: GoCQHTTP_GetStrangerInfo diff --git a/src/onebot11/action/msg/GetMsg.ts b/src/onebot11/action/msg/GetMsg.ts index 43e5ffbb..784a84d0 100644 --- a/src/onebot11/action/msg/GetMsg.ts +++ b/src/onebot11/action/msg/GetMsg.ts @@ -11,7 +11,7 @@ export type ReturnDataType = OB11Message const SchemaData = { type: 'object', properties: { - message_id: { type: 'number' }, + message_id: { type: ['number','string'] }, }, required: ['message_id'] } as const satisfies JSONSchema; @@ -26,7 +26,7 @@ class GetMsg extends BaseAction { if (!payload.message_id) { throw Error('参数message_id不能为空'); } - let msg = await dbUtil.getMsgByShortId(payload.message_id); + let msg = await dbUtil.getMsgByShortId(parseInt(payload.message_id.toString())); if (!msg) { msg = await dbUtil.getMsgByLongId(payload.message_id.toString()); }