From 8c670d1174b2089f1a9e4d90c101385a39406ea3 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Fri, 27 Dec 2024 22:16:36 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E9=93=BE=E6=8E=A5=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20channelId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wai-server/core/baileys/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wai-server/core/baileys/index.js b/wai-server/core/baileys/index.js index cea506b..6a8f8fc 100644 --- a/wai-server/core/baileys/index.js +++ b/wai-server/core/baileys/index.js @@ -55,6 +55,11 @@ const createWhatsApp = async phone => { const sendTextMessage = async (number, content) => { const jid = formatPhoneNumber(number); + + if (number === whatsAppNo) { + // whatsAppNo + } + try { const msgInfo = await waSocket.sendMessage(jid, { text: content }); waSocket.sendMessage(jid, { text: content }) @@ -279,7 +284,7 @@ const createWhatsApp = async phone => { console.log('Connection closed: ', lastDisconnect); waEmitter.emit('connection:close', { - whatsAppNo, + whatsAppNo, channelId, eventSource: 'connection.update.close', status: 'offline', }); @@ -288,7 +293,7 @@ const createWhatsApp = async phone => { // 扫码成功后向这个群发消息,后续就能使用 API 发送了。 sendTextMessage('120363363417115199@g.us', whatsAppNo + ' 登录成功:' + new Date().toString()); waEmitter.emit('connection:open', { - status: 'open', whatsAppNo, + status: 'open', whatsAppNo, channelId, eventSource: 'connection.update.open', }); } else if (qr !== undefined) {