mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Close disconnect fix
This commit is contained in:
@@ -5,7 +5,6 @@ import * as assert from 'assert'
|
||||
|
||||
import { decodeMediaMessage, validateJIDForSending } from './Utils'
|
||||
import { promiseTimeout, createTimeout } from '../WAConnection/Utils'
|
||||
import { WAMessageContent, WAMessage } from '../WAConnection/Constants'
|
||||
|
||||
require ('dotenv').config () // dotenv to load test jid
|
||||
const testJid = process.env.TEST_JID || '1234@s.whatsapp.net' // set TEST_JID=xyz@s.whatsapp.net in a .env file in the root directory
|
||||
|
||||
@@ -278,6 +278,7 @@ export default class WAConnectionBase {
|
||||
close() {
|
||||
this.msgCount = 0
|
||||
if (this.conn) {
|
||||
this.conn.removeAllListeners ('close')
|
||||
this.conn.close()
|
||||
this.conn = null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user