From b7ac3bff30eeeeff84ee303ae4be18b9ea9f1e3a Mon Sep 17 00:00:00 2001 From: Maitaozi <27204037@163.com> Date: Mon, 26 Jun 2023 02:56:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=9D=9EQQ=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?AI=E5=9B=9E=E5=A4=8D=E5=90=8E=E4=BE=9D=E7=84=B6=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=BC=82=E5=B8=B8=E5=9B=BE=E7=89=87=20(#491)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/common.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/common.js b/utils/common.js index 24373ea..3c7aafd 100644 --- a/utils/common.js +++ b/utils/common.js @@ -81,8 +81,12 @@ export async function tryTimes (promiseFn, maxTries = 10) { export async function makeForwardMsg (e, msg = [], dec = '') { let nickname = Bot.nickname if (e.isGroup) { - let info = await Bot.getGroupMemberInfo(e.group_id, Bot.uin) - nickname = info.card || info.nickname + try { + let info = await Bot.getGroupMemberInfo(e.group_id, Bot.uin) + nickname = info.card || info.nickname + } catch (err) { + console.error(`Failed to get group member info: ${err}`) + } } let userInfo = { user_id: Bot.uin, @@ -801,4 +805,4 @@ export function getMaxModelTokens (model = 'gpt-3.5-turbo') { return 16000 } } -} \ No newline at end of file +}