From 27737dfe0d9ad2b7e926f13671b018ca4ec6aa28 Mon Sep 17 00:00:00 2001 From: Zyy955 <74231782+Zyy955@users.noreply.github.com> Date: Tue, 28 Nov 2023 03:09:05 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=A4=9Abot=E4=B8=8B`e.bot`?= =?UTF-8?q?=E4=B8=BA=E9=BB=98=E8=AE=A4ICQQ=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/common.js | 10 +++------- lib/plugins/loader.js | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/common/common.js b/lib/common/common.js index f0e500e..57c5e29 100644 --- a/lib/common/common.js +++ b/lib/common/common.js @@ -80,9 +80,7 @@ async function makeForwardMsg (e, msg = [], dec = '', msgsscr = false) { try { let info = await e.bot.getGroupMemberInfo(e.group_id, id) name = info.card || info.nickname - } catch (err) { - logger.error(err) - } + } catch (err) { } } let userInfo = { @@ -125,10 +123,8 @@ async function makeForwardMsg (e, msg = [], dec = '', msgsscr = false) { .replace(/___+/, `${dec}`) } } - } catch (err) { - logger.error(err) - } - + } catch (err) { } + return forwardMsg } diff --git a/lib/plugins/loader.js b/lib/plugins/loader.js index 67c953d..ded7ed4 100644 --- a/lib/plugins/loader.js +++ b/lib/plugins/loader.js @@ -177,7 +177,7 @@ class PluginsLoader { */ async deal (e) { Object.defineProperty(e, 'bot', { - value: Bot + value: Bot[e?.self_id || Bot.uin] }) /** 检查频道消息 */ if (this.checkGuildMsg(e)) return