davexbaileys 1.1.2 → 2.5.8
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 +16 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<h1>
|
|
2
|
+
<h1>Davebaileys</h1>
|
|
3
3
|
<p>A WebSocket-based JavaScript library for interacting with the WhatsApp Web API</p>
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/davebaileys)
|
|
6
|
+
[](https://www.npmjs.com/package/davebaileys)
|
|
7
|
+
[](https://github.com/Davex-254/davebaileys/blob/main/LICENSE)
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
10
|
## Disclaimer
|
|
@@ -14,59 +14,36 @@ This project is not affiliated, associated, authorized, endorsed by, or in any w
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
npm install
|
|
17
|
+
npm install davebaileys
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Or using yarn:
|
|
21
21
|
```bash
|
|
22
|
-
yarn add
|
|
22
|
+
yarn add davebaileys
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Quick Start
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
### CommonJS (Recommended)
|
|
29
28
|
```javascript
|
|
30
|
-
|
|
29
|
+
const { default: makeWASocket, useMultiFileAuthState, Browsers } = require('davebaileys')
|
|
31
30
|
```
|
|
32
31
|
|
|
33
|
-
###
|
|
34
|
-
|
|
32
|
+
### ES Modules / TypeScript
|
|
35
33
|
```javascript
|
|
36
|
-
import
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const { state, saveCreds } = await useMultiFileAuthState('auth_info')
|
|
40
|
-
|
|
41
|
-
const sock = makeWASocket({
|
|
42
|
-
auth: state,
|
|
43
|
-
printQRInTerminal: false
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
sock.ev.on('creds.update', saveCreds)
|
|
47
|
-
|
|
48
|
-
sock.ev.on('connection.update', ({ connection, lastDisconnect, qr }) => {
|
|
49
|
-
if (qr) console.log('Scan QR:', qr)
|
|
50
|
-
|
|
51
|
-
if (connection === 'close') {
|
|
52
|
-
const shouldReconnect = (lastDisconnect?.error instanceof Boom)
|
|
53
|
-
&& lastDisconnect.error.output.statusCode !== DisconnectReason.loggedOut
|
|
54
|
-
if (shouldReconnect) connectToWA()
|
|
55
|
-
} else if (connection === 'open') {
|
|
56
|
-
console.log('Connected!')
|
|
57
|
-
}
|
|
58
|
-
})
|
|
34
|
+
import pkg from 'davebaileys'
|
|
35
|
+
const { default: makeWASocket, useMultiFileAuthState, Browsers } = pkg
|
|
59
36
|
```
|
|
60
37
|
|
|
61
38
|
## Features
|
|
62
39
|
|
|
63
|
-
- Full WhatsApp Web API support
|
|
40
|
+
- Full WhatsApp Web API support
|
|
64
41
|
- Multi-device support with QR code and pairing code authentication
|
|
65
|
-
- LID (Link ID) addressing support for personal chats and groups
|
|
66
|
-
-
|
|
42
|
+
- LID (Link ID) addressing support for both personal chats and groups
|
|
43
|
+
- Group status/story sending functionality
|
|
44
|
+
- Session management and restoration
|
|
67
45
|
- Message sending, receiving, and manipulation
|
|
68
46
|
- Group management
|
|
69
|
-
- Newsletter / channel support
|
|
70
47
|
- Privacy settings
|
|
71
48
|
- Profile management
|
|
72
49
|
- And much more!
|