fix: replace deprecated calls

This commit is contained in:
Wesley F. Young
2024-08-12 08:19:28 +08:00
parent 257135763f
commit a88c37ea56
18 changed files with 54 additions and 54 deletions

View File

@@ -88,7 +88,7 @@ export class OB11Constructor {
//resMsg.sender.nickname = user.info.nick;
} else if (msg.chatType == ChatType.temp) {
resMsg.sub_type = 'group';
let ret = await NTQQMsgApi.getTempChatInfo(ChatType.temp, msg.senderUid);
const ret = await NTQQMsgApi.getTempChatInfo(ChatType.temp, msg.senderUid);
if (ret.result === 0) {
resMsg.group_id = parseInt(ret.tmpChatInfo!.groupCode);
resMsg.sender.nickname = ret.tmpChatInfo!.fromNick;
@@ -278,13 +278,13 @@ export class OB11Constructor {
chatType: msg.chatType,
guildId: '',
},
msg.msgId,
msg.msgSeq,
msg.senderUid,
element.elementId,
element.elementType.toString(),
element.pttElement.fileSize || '0',
element.pttElement.fileUuid || '',
msg.msgId,
msg.msgSeq,
msg.senderUid,
element.elementId,
element.elementType.toString(),
element.pttElement.fileSize || '0',
element.pttElement.fileUuid || '',
);
//以uuid作为文件名
} else if (element.arkElement) {
@@ -477,7 +477,7 @@ export class OB11Constructor {
logger.logDebug(`收到我被踢出或退群提示, 群${msg.peerUid}`, groupElement);
NTQQGroupApi.quitGroup(msg.peerUid).then();
try {
const adminUin = (await NTQQGroupApi.getGroupMember(msg.peerUid, groupElement.adminUid))?.uin || (await NTQQUserApi.getUidByUin(groupElement.adminUid));
const adminUin = (await NTQQGroupApi.getGroupMember(msg.peerUid, groupElement.adminUid))?.uin || (await NTQQUserApi.getUidByUinV2(groupElement.adminUid));
if (adminUin) {
return new OB11GroupDecreaseEvent(
core,

View File

@@ -20,7 +20,7 @@ async function handleMsg(coreContext: NapCatCore, msg: OB11Message, quickAction:
const reply = quickAction.reply;
const peer: Peer = {
chatType: ChatType.friend,
peerUid: await coreContext.apis.UserApi.getUidByUin(msg.user_id.toString()) as string,
peerUid: await coreContext.apis.UserApi.getUidByUinV2(msg.user_id.toString()) as string,
};
if (msg.message_type == 'private') {
if (msg.sub_type === 'group') {