@jkt48connect-corp/baileys 7.3.3 → 7.3.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 +12 -12
- package/package.json +2 -2
package/README.md
CHANGED
@@ -26,17 +26,17 @@ Here is an example you can use: [example.ts](Example/example.ts) or here is a tu
|
|
26
26
|
|
27
27
|
Use the stable version:
|
28
28
|
```bash
|
29
|
-
npm install @
|
29
|
+
npm install @jkt48connect-corp/baileys
|
30
30
|
```
|
31
31
|
|
32
32
|
Use the edge version (no guarantee of stability, but latest fixes + features)
|
33
33
|
```bash
|
34
|
-
yarn add @
|
34
|
+
yarn add @jkt48connect-corp/baileys@latest
|
35
35
|
```
|
36
36
|
|
37
37
|
Then import your code using:
|
38
38
|
```javascript
|
39
|
-
const { default: makeWASocket } = require("@
|
39
|
+
const { default: makeWASocket } = require("@jkt48connect-corp/baileys")
|
40
40
|
```
|
41
41
|
|
42
42
|
# Index
|
@@ -164,7 +164,7 @@ WhatsApp provides a multi-device API that allows Baileys to be authenticated as
|
|
164
164
|
> You can customize browser name if you connect with **QR-CODE**, with `Browser` constant, we have some browsers config, **see [here](https://baileys.whiskeysockets.io/types/BrowsersMap.html)**
|
165
165
|
|
166
166
|
```javascript
|
167
|
-
const { default: makeWASocket } = require("@
|
167
|
+
const { default: makeWASocket } = require("@jkt48connect-corp/baileys")
|
168
168
|
|
169
169
|
|
170
170
|
const sock = makeWASocket({
|
@@ -185,7 +185,7 @@ If the connection is successful, you will see a QR code printed on your terminal
|
|
185
185
|
The phone number can't have `+` or `()` or `-`, only numbers, you must provide country code
|
186
186
|
|
187
187
|
```javascript
|
188
|
-
const { default: makeWASocket } = require("@
|
188
|
+
const { default: makeWASocket } = require("@jkt48connect-corp/baileys")
|
189
189
|
|
190
190
|
const sock = makeWASocket({
|
191
191
|
// can provide additional config here
|
@@ -267,8 +267,8 @@ You obviously don't want to keep scanning the QR code every time you want to con
|
|
267
267
|
|
268
268
|
So, you can load the credentials to log back in:
|
269
269
|
```javascript
|
270
|
-
const makeWASocket = require("@
|
271
|
-
const { useMultiFileAuthState } = require("@
|
270
|
+
const makeWASocket = require("@jkt48connect-corp/baileys").default;
|
271
|
+
const { useMultiFileAuthState } = require("@jkt48connect-corp/baileys");
|
272
272
|
|
273
273
|
const { state, saveCreds } = await useMultiFileAuthState('auth_info_baileys')
|
274
274
|
|
@@ -308,8 +308,8 @@ sock.ev.on('messages.upsert', ({ messages }) => {
|
|
308
308
|
> This example includes basic auth storage too
|
309
309
|
|
310
310
|
```javascript
|
311
|
-
const makeWASocket = require("@
|
312
|
-
const { DisconnectReason, useMultiFileAuthState } = require("@
|
311
|
+
const makeWASocket = require("@jkt48connect-corp/baileys").default;
|
312
|
+
const { DisconnectReason, useMultiFileAuthState } = require("@jkt48connect-corp/baileys");
|
313
313
|
const Boom = require('@hapi/boom');
|
314
314
|
|
315
315
|
async function connectToWhatsApp () {
|
@@ -391,8 +391,8 @@ sock.ev.on('messages.update', event => {
|
|
391
391
|
It can be used as follows:
|
392
392
|
|
393
393
|
```javascript
|
394
|
-
const makeWASocket = require("@
|
395
|
-
const { makeInMemoryStore } = require("@
|
394
|
+
const makeWASocket = require("@jkt48connect-corp/baileys").default;
|
395
|
+
const { makeInMemoryStore } = require("@jkt48connect-corp/baileys");
|
396
396
|
// the store maintains the data of the WA connection in memory
|
397
397
|
// can be written out to a file & read from it
|
398
398
|
const store = makeInMemoryStore({ })
|
@@ -1102,7 +1102,7 @@ await sock.sendMessage(jid, {
|
|
1102
1102
|
If you want to save the media you received
|
1103
1103
|
```javascript
|
1104
1104
|
const { createWriteStream } = require('fs');
|
1105
|
-
const { downloadMediaMessage, getContentType } = require("@
|
1105
|
+
const { downloadMediaMessage, getContentType } = require("@jkt48connect-corp/baileys");
|
1106
1106
|
|
1107
1107
|
sock.ev.on('messages.upsert', async ({ [m] }) => {
|
1108
1108
|
if (!m.message) return // if there is no text or media message
|
package/package.json
CHANGED