fix: OnGroupNotifiesUpdated catch getUserDetailInfo

This commit is contained in:
手瓜一十雪 2024-05-12 23:22:53 +08:00 committed by linyuchen
parent ba46bcdeae
commit 9d3522da54
2 changed files with 13 additions and 4 deletions

View File

@ -12,5 +12,6 @@ QQ Version: Windows 9.9.9-23424 / Linux 3.2.7-23361
## 新增与调整 ## 新增与调整
* 新增设置群公告 Api: /_send_group_notice * 新增设置群公告 Api: /_send_group_notice
* 新增重启实现 包括重启快速登录/普通重启 * 新增重启实现 包括重启快速登录/普通重启
* 支持WebUi热重载配置
新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api) 新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api)

View File

@ -130,12 +130,20 @@ export class NapCatOnebot11 {
groupListener.onGroupNotifiesUpdated = async (doubt, notifies) => { groupListener.onGroupNotifiesUpdated = async (doubt, notifies) => {
for (let i = 0; i < notifies.length; i++) { for (let i = 0; i < notifies.length; i++) {
if (notifies[i].user1.uid && notifies[i].user1.uid.startsWith('u_')) { if (notifies[i].user1.uid && notifies[i].user1.uid.startsWith('u_')) {
let UserInfo_User1 = await NTQQUserApi.getUserDetailInfo(notifies[i].user1.uid); try {
const UserInfo_User1 = await NTQQUserApi.getUserDetailInfo(notifies[i].user1.uid);
uid2UinMap[UserInfo_User1.uid] = UserInfo_User1.uin; uid2UinMap[UserInfo_User1.uid] = UserInfo_User1.uin;
}catch (e) {
logDebug('获取群通知相关信息失败' + e, notifies[i].user1.uid);
}
} }
if (notifies[i].user2.uid && notifies[i].user2.uid.startsWith('u_')) { if (notifies[i].user2.uid && notifies[i].user2.uid.startsWith('u_')) {
let UserInfo_User2 = await NTQQUserApi.getUserDetailInfo(notifies[i].user2.uid); try {
const UserInfo_User2 = await NTQQUserApi.getUserDetailInfo(notifies[i].user2.uid);
uid2UinMap[UserInfo_User2.uid] = UserInfo_User2.uin; uid2UinMap[UserInfo_User2.uid] = UserInfo_User2.uin;
}catch (e) {
logDebug('获取群通知相关信息失败' + e, notifies[i].user2.uid);
}
} }
} }
//console.log('ob11 onGroupNotifiesUpdated', notifies[0]); //console.log('ob11 onGroupNotifiesUpdated', notifies[0]);