diff --git a/src/onebot/action/go-cqhttp/GetForwardMsg.ts b/src/onebot/action/go-cqhttp/GetForwardMsg.ts index 26eccb84..b640b2d8 100644 --- a/src/onebot/action/go-cqhttp/GetForwardMsg.ts +++ b/src/onebot/action/go-cqhttp/GetForwardMsg.ts @@ -61,7 +61,7 @@ export class GoCQHTTPGetForwardMsgAction extends BaseAction { } const rootMsgId = MessageUnique.getShortIdByMsgId(msgId); - const rootMsg = MessageUnique.getMsgIdAndPeerByShortId(rootMsgId || parseInt(msgId)); + const rootMsg = MessageUnique.getMsgIdAndPeerByShortId(rootMsgId ?? +msgId); if (!rootMsg) { throw new Error('msg not found'); } @@ -76,7 +76,7 @@ export class GoCQHTTPGetForwardMsgAction extends BaseAction { if (!(resMsg?.message?.[0] as OB11MessageForward)?.data?.content) { throw new Error('找不到相关的聊天记录'); } - return { + return { messages: (resMsg?.message?.[0] as OB11MessageForward)?.data?.content }; //} diff --git a/src/onebot/action/go-cqhttp/SetQQProfile.ts b/src/onebot/action/go-cqhttp/SetQQProfile.ts index e2ac98e4..e010d6cc 100644 --- a/src/onebot/action/go-cqhttp/SetQQProfile.ts +++ b/src/onebot/action/go-cqhttp/SetQQProfile.ts @@ -14,7 +14,7 @@ const SchemaData = { type Payload = FromSchema; -export class SetQQProfile extends BaseAction { +export class SetQQProfile extends BaseAction { actionName = ActionName.SetQQProfile; payloadSchema = SchemaData; diff --git a/src/onebot/action/group/GetGroupMemberInfo.ts b/src/onebot/action/group/GetGroupMemberInfo.ts index 82f734ef..652eb21d 100644 --- a/src/onebot/action/group/GetGroupMemberInfo.ts +++ b/src/onebot/action/group/GetGroupMemberInfo.ts @@ -44,7 +44,7 @@ class GetGroupMemberInfo extends BaseAction { } else { this.core.context.logger.logDebug(`获取群成员详细信息失败, 只能返回基础信息`); } - return OB11Entities.groupMember(payload.group_id.toString(), member as GroupMember); + return OB11Entities.groupMember(payload.group_id.toString(), member); } } diff --git a/src/onebot/action/group/GetGroupShutList.ts b/src/onebot/action/group/GetGroupShutList.ts index 8d63e054..f7aa70ec 100644 --- a/src/onebot/action/group/GetGroupShutList.ts +++ b/src/onebot/action/group/GetGroupShutList.ts @@ -1,4 +1,3 @@ -import { OB11Group } from '@/onebot'; import BaseAction from '../BaseAction'; import { ActionName } from '../types'; import { FromSchema, JSONSchema } from 'json-schema-to-ts'; diff --git a/src/onebot/action/msg/GetMsg.ts b/src/onebot/action/msg/GetMsg.ts index 1764e465..851baf98 100644 --- a/src/onebot/action/msg/GetMsg.ts +++ b/src/onebot/action/msg/GetMsg.ts @@ -28,7 +28,7 @@ class GetMsg extends BaseAction { throw Error('参数message_id不能为空'); } const MsgShortId = MessageUnique.getShortIdByMsgId(payload.message_id.toString()); - const msgIdWithPeer = MessageUnique.getMsgIdAndPeerByShortId(MsgShortId || parseInt(payload.message_id.toString())); + const msgIdWithPeer = MessageUnique.getMsgIdAndPeerByShortId(MsgShortId ?? +payload.message_id); if (!msgIdWithPeer) { throw new Error('消息不存在'); } diff --git a/src/onebot/action/msg/SendMsg.ts b/src/onebot/action/msg/SendMsg.ts index a7ae999e..cd6bd025 100644 --- a/src/onebot/action/msg/SendMsg.ts +++ b/src/onebot/action/msg/SendMsg.ts @@ -68,7 +68,7 @@ export async function createContext(core: NapCatCore, payload: OB11PostContext, } return { chatType: ChatType.KCHATTYPEC2C, - peerUid: Uid!, + peerUid: Uid, guildId: '', }; } @@ -175,7 +175,7 @@ export class SendMsg extends BaseAction { if (getSpecialMsgNum({ message: OB11Data }, OB11MessageDataType.node)) { const uploadReturnData = await this.uploadForwardedNodesPacket(msgPeer, OB11Data as OB11MessageNode[], node.data.source, node.data.news, node.data.summary, node.data.prompt, { - user_id: (node.data.user_id || node.data.uin)?.toString() ?? parentMeta?.user_id ?? this.core.selfInfo.uin, + user_id: (node.data.user_id ?? node.data.uin)?.toString() ?? parentMeta?.user_id ?? this.core.selfInfo.uin, nickname: (node.data.nickname || node.data.name) ?? parentMeta?.nickname ?? "QQ用户", }, dp + 1); sendElements = uploadReturnData?.finallySendElements ? [uploadReturnData.finallySendElements] : [];