diff --git a/apps/update.js b/apps/update.js index f22c8a6d..2effe56b 100644 --- a/apps/update.js +++ b/apps/update.js @@ -186,13 +186,14 @@ export class Update extends plugin { * @returns */ async makeForwardMsg (title, msg, end) { - let nickname = (this.e.bot ?? Bot).nickname + const _bot = this.e.bot ?? Bot + let nickname = _bot.nickname if (this.e.isGroup) { - let info = await (this.e.bot ?? Bot).getGroupMemberInfo(this.e.group_id, (this.e.bot ?? Bot).uin) + let info = await _bot?.pickMember?.(this.e.group_id, _bot.uin) || await _bot?.getGroupMemberInfo?.(this.e.group_id, _bot.uin) nickname = info.card || info.nickname } let userInfo = { - user_id: (this.e.bot ?? Bot).uin, + user_id: _bot.uin, nickname } diff --git a/model/core.js b/model/core.js index 7d1b9979..78de7952 100644 --- a/model/core.js +++ b/model/core.js @@ -1058,7 +1058,7 @@ async function collectTools (e) { } let systemAddition = '' if (e.isGroup) { - let botInfo = await e.bot.getGroupMemberInfo(e.group_id, getUin(e), true) + let botInfo = await e.bot?.pickMember?.(e.group_id, getUin(e), true) || await e.bot?.getGroupMemberInfo?.(e.group_id, getUin(e), true) if (botInfo.role !== 'member') { // 管理员才给这些工具 tools.push(...[new EditCardTool(), new JinyanTool(), new KickOutTool(), new HandleMessageMsgTool(), new SetTitleTool()]) diff --git a/utils/tools/QueryUserinfoTool.js b/utils/tools/QueryUserinfoTool.js index 974c08b0..2a0d422f 100644 --- a/utils/tools/QueryUserinfoTool.js +++ b/utils/tools/QueryUserinfoTool.js @@ -18,8 +18,8 @@ export class QueryUserinfoTool extends AbstractTool { try { let { qq } = opts qq = isNaN(qq) || !qq ? e.sender.user_id : parseInt(qq.trim()) - if (e.isGroup && typeof e.bot.getGroupMemberInfo === 'function') { - let user = await e.bot.getGroupMemberInfo(e.group_id, qq || e.sender.user_id, true) + if (e.isGroup) { + let user = await e.bot?.pickMember?.(e.group_id, qq || e.sender.user_id, true) || await e.bot?.getGroupMemberInfo?.(e.group_id, qq || e.sender.user_id, true) // let mm = await e.group.getMemberMap() // let user = mm.get(qq) || e.sender.user_id let master = (await getMasterQQ())[0]