企业微信有长度限制,超长的进行分段提交 (#2255)

This commit is contained in:
pharaoh2012 2024-03-02 16:15:58 +08:00 committed by GitHub
parent 11c789c71c
commit f07093d29f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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(',');