junexbaileys 1.0.4 → 1.0.5
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 +21 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,33 +54,30 @@ To run the example script, download or clone the repo and then type the followin
|
|
|
54
54
|
|
|
55
55
|
## Install
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
npm install junexbaileys
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Use the edge version (no guarantee of stability, but latest fixes + features)
|
|
63
|
-
```
|
|
64
|
-
yarn add github:WhiskeySockets/Baileys
|
|
65
|
-
```
|
|
57
|
+
Install this fork while keeping the standard Baileys package name and imports:
|
|
66
58
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
import makeWASocket from 'junexbaileys'
|
|
59
|
+
```bash
|
|
60
|
+
npm install @whiskeysockets/baileys@npm:junexbaileys@1.0.5
|
|
70
61
|
```
|
|
71
62
|
|
|
72
|
-
This
|
|
63
|
+
This adds the following dependency to your application's `package.json`:
|
|
73
64
|
|
|
74
|
-
```
|
|
75
|
-
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@whiskeysockets/baileys": "npm:junexbaileys@1.0.5"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
76
71
|
```
|
|
77
72
|
|
|
78
|
-
|
|
73
|
+
Because the package is installed under the standard alias, keep using the normal Baileys import:
|
|
79
74
|
|
|
80
75
|
```ts
|
|
81
|
-
import makeWASocket from '
|
|
76
|
+
import makeWASocket from '@whiskeysockets/baileys'
|
|
82
77
|
```
|
|
83
78
|
|
|
79
|
+
The alias points to `junexbaileys@1.0.5`, while your application continues to use `@whiskeysockets/baileys` in source code.
|
|
80
|
+
|
|
84
81
|
# Links
|
|
85
82
|
|
|
86
83
|
- [Discord](https://discord.gg/WeJM5FP9GG)
|
|
@@ -208,7 +205,7 @@ WhatsApp provides a multi-device API that allows Baileys to be authenticated as
|
|
|
208
205
|
> You can customize browser name if you connect with **QR-CODE**, with `Browser` constant, we have some browsers config, **see the [BrowsersMap type alias](https://baileys.wiki/docs/api/type-aliases/BrowsersMap/)**
|
|
209
206
|
|
|
210
207
|
```ts
|
|
211
|
-
import makeWASocket from '
|
|
208
|
+
import makeWASocket from '@whiskeysockets/baileys'
|
|
212
209
|
|
|
213
210
|
const sock = makeWASocket({
|
|
214
211
|
// can provide additional config here
|
|
@@ -228,7 +225,7 @@ If the connection is successful, you will see a QR code printed on your terminal
|
|
|
228
225
|
The phone number can't have `+` or `()` or `-`, only numbers, you must provide country code
|
|
229
226
|
|
|
230
227
|
```ts
|
|
231
|
-
import makeWASocket from '
|
|
228
|
+
import makeWASocket from '@whiskeysockets/baileys'
|
|
232
229
|
|
|
233
230
|
const sock = makeWASocket({
|
|
234
231
|
// can provide additional config here
|
|
@@ -301,7 +298,7 @@ You obviously don't want to keep scanning the QR code every time you want to con
|
|
|
301
298
|
|
|
302
299
|
So, you can load the credentials to log back in:
|
|
303
300
|
```ts
|
|
304
|
-
import makeWASocket, { useMultiFileAuthState } from '
|
|
301
|
+
import makeWASocket, { useMultiFileAuthState } from '@whiskeysockets/baileys'
|
|
305
302
|
|
|
306
303
|
const { state, saveCreds } = await useMultiFileAuthState('auth_info_baileys')
|
|
307
304
|
|
|
@@ -344,7 +341,7 @@ sock.ev.on('messages.upsert', ({ messages }) => {
|
|
|
344
341
|
> For reliable serialization of the authentication state, especially when storing as JSON, always use the BufferJSON utility.
|
|
345
342
|
|
|
346
343
|
```ts
|
|
347
|
-
import makeWASocket, { DisconnectReason, useMultiFileAuthState } from '
|
|
344
|
+
import makeWASocket, { DisconnectReason, useMultiFileAuthState } from '@whiskeysockets/baileys'
|
|
348
345
|
import { Boom } from '@hapi/boom'
|
|
349
346
|
|
|
350
347
|
async function connectToWhatsApp () {
|
|
@@ -426,7 +423,7 @@ sock.ev.on('messages.update', event => {
|
|
|
426
423
|
It can be used as follows:
|
|
427
424
|
|
|
428
425
|
```ts
|
|
429
|
-
import makeWASocket, { makeInMemoryStore } from '
|
|
426
|
+
import makeWASocket, { makeInMemoryStore } from '@whiskeysockets/baileys'
|
|
430
427
|
// the store maintains the data of the WA connection in memory
|
|
431
428
|
// can be written out to a file & read from it
|
|
432
429
|
const store = makeInMemoryStore({ })
|
|
@@ -742,7 +739,7 @@ await sock.sendMessage(jid, {
|
|
|
742
739
|
If you want to save the media you received
|
|
743
740
|
```ts
|
|
744
741
|
import { createWriteStream } from 'fs'
|
|
745
|
-
import { downloadMediaMessage, getContentType } from '
|
|
742
|
+
import { downloadMediaMessage, getContentType } from '@whiskeysockets/baileys'
|
|
746
743
|
|
|
747
744
|
sock.ev.on('messages.upsert', async ({ [m] }) => {
|
|
748
745
|
if (!m.message) return // if there is no text or media message
|
|
@@ -1230,7 +1227,7 @@ await sock.sendMessage(
|
|
|
1230
1227
|
This fork includes `sock.sendGroupStatus` for attempting to post a text, image, video, audio, or sticker status to a group. This is an **experimental, undocumented WhatsApp protocol path** and is not part of the official Baileys API. The presence of the protobuf fields in Baileys does not guarantee that WhatsApp will accept or display the post. Test with a non-critical linked account and group, and verify the result in the official WhatsApp app before relying on it.
|
|
1231
1228
|
|
|
1232
1229
|
```ts
|
|
1233
|
-
import makeWASocket from '
|
|
1230
|
+
import makeWASocket from '@whiskeysockets/baileys'
|
|
1234
1231
|
|
|
1235
1232
|
const sock = makeWASocket({ /* your socket config */ })
|
|
1236
1233
|
const groupJid = '120363000000000000@g.us'
|