diff --git a/src/onebot/action/go-cqhttp/GetFriendMsgHistory.ts b/src/onebot/action/go-cqhttp/GetFriendMsgHistory.ts index b899cb2b..e694c046 100644 --- a/src/onebot/action/go-cqhttp/GetFriendMsgHistory.ts +++ b/src/onebot/action/go-cqhttp/GetFriendMsgHistory.ts @@ -48,12 +48,12 @@ export default class GetFriendMsgHistory extends BaseAction { if (!startMsgId) throw `消息${payload.message_seq}不存在`; msgList = (await NTQQMsgApi.getMsgHistory(peer, startMsgId, MsgCount)).msgList; } - if(isReverseOrder) msgList.reverse(); + if (isReverseOrder) msgList.reverse(); await Promise.all(msgList.map(async msg => { msg.id = MessageUnique.createMsg({ guildId: '', chatType: msg.chatType, peerUid: msg.peerUid }, msg.msgId); })); //转换消息 - const ob11MsgList = await Promise.all(msgList.map(msg => OB11Constructor.message(msg))); + const ob11MsgList = await Promise.all(msgList.map(msg => OB11Constructor.message(this.CoreContext, msg, "array"))); return { 'messages': ob11MsgList }; } } diff --git a/src/onebot/action/go-cqhttp/UploadGroupFile.ts b/src/onebot/action/go-cqhttp/UploadGroupFile.ts index be1eb2e9..1632c888 100644 --- a/src/onebot/action/go-cqhttp/UploadGroupFile.ts +++ b/src/onebot/action/go-cqhttp/UploadGroupFile.ts @@ -33,7 +33,7 @@ export default class GoCQHTTPUploadGroupFile extends BaseAction { throw new Error(downloadResult.errMsg); } const sendFileEle: SendFileElement = await SendMsgElementConstructor.file(this.CoreContext, downloadResult.path, payload.name, payload.folder_id); - await sendMsg({ chatType: ChatType.group, peerUid: payload.group_id.toString() }, [sendFileEle], [], true); + await sendMsg(this.CoreContext, { chatType: ChatType.group, peerUid: payload.group_id.toString() }, [sendFileEle], [], true); return null; } } diff --git a/src/onebot/action/go-cqhttp/UploadPrivareFile.ts b/src/onebot/action/go-cqhttp/UploadPrivareFile.ts index 2a88e033..8f0f5c0e 100644 --- a/src/onebot/action/go-cqhttp/UploadPrivareFile.ts +++ b/src/onebot/action/go-cqhttp/UploadPrivareFile.ts @@ -45,7 +45,7 @@ export default class GoCQHTTPUploadPrivateFile extends BaseAction throw new Error(downloadResult.errMsg); } const sendFileEle: SendFileElement = await SendMsgElementConstructor.file(this.CoreContext, downloadResult.path, payload.name); - await sendMsg(peer, [sendFileEle], [], true); + await sendMsg(this.CoreContext, peer, [sendFileEle], [], true); return null; } } diff --git a/src/onebot/action/group/SetGroupAdmin.ts b/src/onebot/action/group/SetGroupAdmin.ts index b187b306..4f9feb27 100644 --- a/src/onebot/action/group/SetGroupAdmin.ts +++ b/src/onebot/action/group/SetGroupAdmin.ts @@ -21,7 +21,10 @@ export default class SetGroupAdmin extends BaseAction { PayloadSchema = SchemaData; protected async _handle(payload: Payload): Promise { const NTQQGroupApi = this.CoreContext.getApiContext().GroupApi; - await NTQQGroupApi.setMemberRole(payload.group_id.toString(), member.uid, enable ? GroupMemberRole.admin : GroupMemberRole.normal); + const NTQQUserApi = this.CoreContext.getApiContext().UserApi; + let uid = await NTQQUserApi.getUidByUin(payload.user_id.toString()) + if(!uid) throw new Error('get Uid Error') + await NTQQGroupApi.setMemberRole(payload.group_id.toString(), uid, payload.enable ? GroupMemberRole.admin : GroupMemberRole.normal); return null; } } diff --git a/src/onebot/action/msg/GetMsg.ts b/src/onebot/action/msg/GetMsg.ts index 62a80bdb..4f84d8ae 100644 --- a/src/onebot/action/msg/GetMsg.ts +++ b/src/onebot/action/msg/GetMsg.ts @@ -36,7 +36,7 @@ class GetMsg extends BaseAction { const msg = await NTQQMsgApi.getMsgsByMsgId( peer, [msgIdWithPeer?.MsgId || payload.message_id.toString()]); - const retMsg = await OB11Constructor.message(msg.msgList[0]); + const retMsg = await OB11Constructor.message(this.CoreContext, msg.msgList[0], "array"); try { retMsg.message_id = MessageUnique.createMsg(peer, msg.msgList[0].msgId)!; retMsg.message_seq = retMsg.message_id;