swan-api 1.1.1 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,22 @@
1
1
  # SWAN
2
2
 
3
- **SWAN** (**S**imple **W**hatsApp **A**PI for **N**ode) is a lightweight wrapper around the Baileys library that provides a simpler and more intuitive interface for building WhatsApp bots in Node.js.
4
-
5
-
3
+ <table width="100%">
4
+ <tr>
5
+ <td width="220" align="center" valign="middle">
6
+ <img src="./assets/logo.png" width="180" alt="SWAN Logo">
7
+ </td>
8
+ <td valign="middle">
9
+ <p>
10
+ <strong>S</strong>imple <strong>W</strong>hatsApp
11
+ <strong>A</strong>PI for <strong>N</strong>ode.js
12
+ </p>
13
+ <p>
14
+ A lightweight wrapper around the Baileys library that provides a simpler
15
+ and more intuitive interface for building WhatsApp bots in Node.js.
16
+ </p>
17
+ </td>
18
+ </tr>
19
+ </table>
6
20
 
7
21
  ## Features
8
22
 
package/Socket.js CHANGED
@@ -83,10 +83,13 @@ export default class Socket extends EventEmitter {
83
83
  if (connection == "close"){
84
84
  const shouldReconnect = lastDisconnect?.error?.output?.statusCode
85
85
  !== DisconnectReason.loggedOut;
86
- if (shouldReconnect)
86
+ if (shouldReconnect){
87
+ this.socket.ev.removeAllListeners()
87
88
  await this.connect()
89
+ }
88
90
  } else if (connection == 'open'){
89
91
  socketReady = true
92
+ this.groupMetadata = this.socket.groupMetadata;
90
93
  this.userId = this.socket.user.id;
91
94
  this.emit('ready');
92
95
  }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swan-api",
3
- "version": "1.1.1",
3
+ "version": "1.1.4",
4
4
  "description": "Simple WhatsApp API for Node",
5
5
  "keywords": [
6
6
  "whatsapp",
@@ -26,6 +26,7 @@
26
26
  ".": "./index.js"
27
27
  },
28
28
  "files": [
29
+ "assets",
29
30
  "index.js",
30
31
  "Socket.js",
31
32
  "Message.js",