From f07093d29f22189bf48350326b79c030bcbcd4f8 Mon Sep 17 00:00:00 2001 From: pharaoh2012 <2225220+pharaoh2012@users.noreply.github.com> Date: Sat, 2 Mar 2024 16:15:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1=E6=9C=89?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E9=99=90=E5=88=B6=EF=BC=8C=E8=B6=85=E9=95=BF?= =?UTF-8?q?=E7=9A=84=E8=BF=9B=E8=A1=8C=E5=88=86=E6=AE=B5=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=20(#2255)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sample/notify.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sample/notify.js b/sample/notify.js index 1e5eee95..55f84bc4 100644 --- a/sample/notify.js +++ b/sample/notify.js @@ -816,7 +816,18 @@ function ChangeUserId(desp) { } } -function qywxamNotify(text, desp) { +async function qywxamNotify(text, desp) { + const MAX_LENGTH = 900; + if (desp.length > MAX_LENGTH) { + let d = desp.substr(0, MAX_LENGTH) + "\n==More=="; + await do_qywxamNotify(text, d); + await qywxamNotify(text, desp.substr(MAX_LENGTH)); + } else { + return await do_qywxamNotify(text,desp); + } +} + +function do_qywxamNotify(text, desp) { return new Promise((resolve) => { if (QYWX_AM) { const QYWX_AM_AY = QYWX_AM.split(',');