From df41b8be3fde6cf1477fb4fc2e16c474eb2aca5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=8C=8C?= Date: Sun, 2 Jun 2024 10:28:32 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=90=20=E7=BB=86=E8=8A=82=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/api/funApi/thumbUpApi.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/model/api/funApi/thumbUpApi.js b/model/api/funApi/thumbUpApi.js index 01401aa..db4bb71 100644 --- a/model/api/funApi/thumbUpApi.js +++ b/model/api/funApi/thumbUpApi.js @@ -40,7 +40,12 @@ export default class ThumbUpApi { async origThumbUp(uid, times) { const friend = this.Bot.pickFriend(uid) if (!friend?.thumbUp) throw new ReplyError("当前协议端不支持点赞,详情查看\nhttps://gitee.com/TimeRainStarSky/Yunzai") - const res = { ...await friend.thumbUp(times) } + let res + try { + res = { ...await friend.thumbUp(times) } + } catch (err) { + if (err?.error) { res = { ...err.error } } else if (err?.stack) { res = { code: 1, msg: err.stack } } else { res = { ...err } } + } if (res.retcode && !res.code) { res.code = res.retcode } if (res.message && !res.msg) { res.msg = res.message } return res