fix(whatsapp): handle group mentions and caller allowlists

This commit is contained in:
xmanrui 2026-08-26 17:07:29 +08:00
parent 54468bbe1e
commit 9664e85599
13 changed files with 563 additions and 214 deletions

View file

@ -53,8 +53,8 @@ function payloadFailure(endpoint, payload) {
&& payload.confirm === true ? null : 'bot.delete requires a botId and confirm=true.';
}
if (endpoint === WHATSAPP_ENDPOINTS.setAccessPolicy) {
if (!exactKeys(payload, ['botId', 'accessMode', 'allowedNumbers'])
|| Object.keys(payload).length !== 3
if (!exactKeys(payload, ['botId', 'accessMode', 'allowedNumbers', 'groupAllowedNumbers'])
|| Object.keys(payload).length !== 4
|| !validId(payload.botId)) return '请输入有效的 WhatsApp 访问模式和电话号码。';
try {
normalizeWhatsappAccessPolicy(payload);