Skip to content

Commit 3cb03de

Browse files
committed
Merge branch 'master' of https://github.com/WhiskeySockets/Baileys into feat-binary-node-rust-wasm
2 parents cec6c72 + cb8b371 commit 3cb03de

30 files changed

+771
-289
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github: [purpshell, jlucaso1, SheIITear]
1+
github: [purpshell, jlucaso1, vinikjkkj, SheIITear]

.github/README.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,22 @@
33

44
> [!CAUTION]
55
> NOTICE OF BREAKING CHANGE.
6-
>
6+
>
77
> As of 7.0.0, multiple breaking changes were introduced into the library.
8-
>
8+
>
99
> Please check out https://whiskey.so/migrate-latest for more information.
1010
1111
Baileys is a WebSockets-based TypeScript library for interacting with the WhatsApp Web API.
1212

1313
Join the WhiskeySockets community via the link: https://whiskey.so/discord
1414

1515

16-
> [!IMPORTANT]
17-
> I made a survey for users of the project to ask questions, and provide Baileys valuable insights regarding its users. I will be publishing the results of this form (after filtering) as well so we can study and understand where we need to work.
18-
>
19-
> The survey is anonymous and requires no personal info at all. You are required to sign-in with Google to keep responses to one person. You are able to edit your response after you submit. The deadline for this form is September 30, 2025.
20-
>
21-
> I encourage you to put the effort, all it takes is 5-10 minutes and you get to ask me any questions you have.
22-
>
23-
> \- Rajeh (purpshell)
24-
>
25-
> Fill in the survey via the link: https://whiskey.so/survey
26-
27-
28-
2916

3017
# Usage & Guide
3118

3219
> [!IMPORTANT]
3320
> The new guide is a work in progress. Expect missing pages/content. [Report missing or incorrect content.](https://github.com/WhiskeySockets/baileys.wiki-site/issues/new)
34-
>
21+
>
3522
> **You can still access the old guide here:** [README.md](https://github.com/WhiskeySockets/Baileys/tree/master/README.md), or the [NPM homepage](https://npmjs.com/package/baileys).
3623
3724
The new guide is posted at https://baileys.wiki .

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 7.0.0-rc.6 (2025-10-19)
1+
# 7.0.0-rc.9 (2025-11-21)
22

33

44

README.md

Lines changed: 43 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,11 @@
55

66
> [!CAUTION]
77
> NOTICE OF BREAKING CHANGE.
8-
>
8+
>
99
> As of 7.0.0, multiple breaking changes were introduced into the library.
10-
>
10+
>
1111
> Please check out https://whiskey.so/migrate-latest for more information.
1212
13-
> [!IMPORTANT]
14-
> I made a survey for users of the project to ask questions, and provide Baileys valuable insights regarding its users. I will be publishing the results of this form (after filtering) as well so we can study and understand where we need to work.
15-
>
16-
> The survey is anonymous and requires no personal info at all. You are required to sign-in with Google to keep responses to one person. You are able to edit your response after you submit. The deadline for this form is September 30, 2025.
17-
>
18-
> I encourage you to put the effort, all it takes is 5-10 minutes and you get to ask me any questions you have.
19-
>
20-
> \- Rajeh (purpshell)
21-
>
22-
> Fill in the survey via the link: https://whiskey.so/survey
23-
24-
2513
# Important Note
2614
This is a temporary README.md, the new guide is in development and will this file will be replaced with .github/README.md (already a default on GitHub).
2715

@@ -39,16 +27,16 @@ Use at your own discretion. Do not spam people with this. We discourage any stal
3927

4028
##
4129

42-
- Baileys does not require Selenium or any other browser to be interface with WhatsApp Web, it does so directly using a **WebSocket**.
43-
- Not running Selenium or Chromium saves you like **half a gig** of ram :/
30+
- Baileys does not require Selenium or any other browser to be interface with WhatsApp Web, it does so directly using a **WebSocket**.
31+
- Not running Selenium or Chromium saves you like **half a gig** of ram :/
4432
- Baileys supports interacting with the multi-device & web versions of WhatsApp.
4533
- Thank you to [@pokearaujo](https://github.com/pokearaujo/multidevice) for writing his observations on the workings of WhatsApp Multi-Device. Also, thank you to [@Sigalor](https://github.com/sigalor/whatsapp-web-reveng) for writing his observations on the workings of WhatsApp Web and thanks to [@Rhymen](https://github.com/Rhymen/go-whatsapp/) for the __go__ implementation.
4634

4735
> [!IMPORTANT]
4836
> The original repository had to be removed by the original author - we now continue development in this repository here.
4937
This is the only official repository and is maintained by the community.
5038
> **Join the Discord [here](https://discord.gg/WeJM5FP9GG)**
51-
39+
5240
## Example
5341

5442
Do check out & run [example.ts](Example/example.ts) to see an example usage of the library.
@@ -71,7 +59,7 @@ yarn add github:WhiskeySockets/Baileys
7159
```
7260

7361
Then import your code using:
74-
```ts
62+
```ts
7563
import makeWASocket from '@whiskeysockets/baileys'
7664
```
7765

@@ -290,7 +278,7 @@ const sock = makeWASocket({
290278
```
291279
## Saving & Restoring Sessions
292280

293-
You obviously don't want to keep scanning the QR code every time you want to connect.
281+
You obviously don't want to keep scanning the QR code every time you want to connect.
294282

295283
So, you can load the credentials to log back in:
296284
```ts
@@ -314,7 +302,7 @@ sock.ev.on('creds.update', saveCreds)
314302

315303
## Handling Events
316304

317-
- Baileys uses the EventEmitter syntax for events.
305+
- Baileys uses the EventEmitter syntax for events.
318306
They're all nicely typed up, so you shouldn't have any issues with an Intellisense editor like VS Code.
319307

320308
> [!IMPORTANT]
@@ -451,10 +439,10 @@ The store also provides some simple functions such as `loadMessages` that utiliz
451439

452440
## Whatsapp IDs Explain
453441

454-
- `id` is the WhatsApp ID, called `jid` too, of the person or group you're sending the message to.
442+
- `id` is the WhatsApp ID, called `jid` too, of the person or group you're sending the message to.
455443
- It must be in the format ```[country code][phone number]@s.whatsapp.net```
456-
- Example for people: ```[email protected]```.
457-
- For groups, it must be in the format ``` [email protected] ```.
444+
- Example for people: ```[email protected]```.
445+
- For groups, it must be in the format ``` [email protected] ```.
458446
- For broadcast lists, it's `[timestamp of creation]@broadcast`.
459447
- For stories, the ID is `status@broadcast`.
460448

@@ -513,7 +501,7 @@ await sock.sendMessage(jid, { forward: msg }) // WA forward the message!
513501
#### Location Message
514502
```ts
515503
await sock.sendMessage(
516-
jid,
504+
jid,
517505
{
518506
location: {
519507
degreesLatitude: 24.121231,
@@ -525,18 +513,18 @@ await sock.sendMessage(
525513
#### Contact Message
526514
```ts
527515
const vcard = 'BEGIN:VCARD\n' // metadata of the contact card
528-
+ 'VERSION:3.0\n'
516+
+ 'VERSION:3.0\n'
529517
+ 'FN:Jeff Singh\n' // full name
530518
+ 'ORG:Ashoka Uni;\n' // the organization of the contact
531519
+ 'TEL;type=CELL;type=VOICE;waid=911234567890:+91 12345 67890\n' // WhatsApp ID + phone number
532520
+ 'END:VCARD'
533521
534522
await sock.sendMessage(
535523
id,
536-
{
537-
contacts: {
538-
displayName: 'Jeff',
539-
contacts: [{ vcard }]
524+
{
525+
contacts: {
526+
displayName: 'Jeff',
527+
contacts: [{ vcard }]
540528
}
541529
}
542530
)
@@ -626,8 +614,8 @@ Sending media (video, stickers, images) is easier & more efficient than ever.
626614
- Whatsapp doesn't support `.gif` files, that's why we send gifs as common `.mp4` video with `gifPlayback` flag
627615
```ts
628616
await sock.sendMessage(
629-
jid,
630-
{
617+
jid,
618+
{
631619
video: fs.readFileSync('Media/ma_gif.mp4'),
632620
caption: 'hello word',
633621
gifPlayback: true
@@ -638,8 +626,8 @@ await sock.sendMessage(
638626
#### Video Message
639627
```ts
640628
await sock.sendMessage(
641-
id,
642-
{
629+
id,
630+
{
643631
video: {
644632
url: './Media/ma_gif.mp4'
645633
},
@@ -663,7 +651,7 @@ await sock.sendMessage(
663651
```
664652
```ts
665653
await sock.sendMessage(
666-
jid,
654+
jid,
667655
{
668656
audio: {
669657
url: './Media/audio.mp3'
@@ -676,8 +664,8 @@ await sock.sendMessage(
676664
#### Image Message
677665
```ts
678666
await sock.sendMessage(
679-
id,
680-
{
667+
id,
668+
{
681669
image: {
682670
url: './Media/ma_img.png'
683671
},
@@ -692,8 +680,8 @@ await sock.sendMessage(
692680

693681
```ts
694682
await sock.sendMessage(
695-
id,
696-
{
683+
id,
684+
{
697685
image: {
698686
url: './Media/ma_img.png'
699687
},
@@ -748,7 +736,7 @@ sock.ev.on('messages.upsert', async ({ [m] }) => {
748736
m,
749737
'stream', // can be 'buffer' too
750738
{ },
751-
{
739+
{
752740
logger,
753741
// pass this so that baileys can request a reupload of media
754742
// that has been deleted
@@ -764,7 +752,7 @@ sock.ev.on('messages.upsert', async ({ [m] }) => {
764752
765753
### Re-upload Media Message to Whatsapp
766754
767-
- WhatsApp automatically removes old media from their servers. For the device to access said media -- a re-upload is required by another device that has it. This can be accomplished using:
755+
- WhatsApp automatically removes old media from their servers. For the device to access said media -- a re-upload is required by another device that has it. This can be accomplished using:
768756
```ts
769757
await sock.updateMediaMessage(msg)
770758
```
@@ -790,17 +778,17 @@ const key: WAMessageKey
790778
await sock.readMessages([key])
791779
```
792780
793-
The message ID is the unique identifier of the message that you are marking as read.
781+
The message ID is the unique identifier of the message that you are marking as read.
794782
On a `WAMessage`, the `messageID` can be accessed using ```messageID = message.key.id```.
795783
796784
### Update Presence
797785
798786
- ``` presence ``` can be one of [these](https://baileys.whiskeysockets.io/types/WAPresence.html)
799787
- The presence expires after about 10 seconds.
800-
- This lets the person/group with `jid` know whether you're online, offline, typing etc.
788+
- This lets the person/group with `jid` know whether you're online, offline, typing etc.
801789
802790
```ts
803-
await sock.sendPresenceUpdate('available', jid)
791+
await sock.sendPresenceUpdate('available', jid)
804792
```
805793
806794
> [!NOTE]
@@ -849,12 +837,12 @@ await sock.chatModify(
849837
messages: [
850838
{
851839
id: 'ATWYHDNNWU81732J',
852-
fromMe: true,
840+
fromMe: true,
853841
timestamp: '1654823909'
854842
}
855843
]
856844
}
857-
},
845+
},
858846
jid
859847
)
860848

@@ -915,7 +903,7 @@ await sock.chatModify({
915903
```ts
916904
// turn on disappearing messages
917905
await sock.sendMessage(
918-
jid,
906+
jid,
919907
// this is 1 week in seconds -- how long you want messages to appear for
920908
{ disappearingMessagesInChat: WA_DEFAULT_EPHEMERAL }
921909
)
@@ -925,7 +913,7 @@ await sock.sendMessage(jid, { text: 'hello' }, { ephemeralExpiration: WA_DEFAULT
925913

926914
// turn off disappearing messages
927915
await sock.sendMessage(
928-
jid,
916+
jid,
929917
{ disappearingMessagesInChat: false }
930918
)
931919
```
@@ -980,7 +968,7 @@ console.log('business description: ' + profile.description + ', category: ' + pr
980968
sock.ev.on('presence.update', console.log)
981969

982970
// request updates for a chat
983-
await sock.presenceSubscribe(jid)
971+
await sock.presenceSubscribe(jid)
984972
```
985973
986974
## Change Profile
@@ -1022,7 +1010,7 @@ await sock.sendMessage(group.id, { text: 'hello there' }) // say hello to everyo
10221010
```ts
10231011
// id & people to add to the group (will throw error if it fails)
10241012
await sock.groupParticipantsUpdate(
1025-
jid,
1013+
jid,
10261014
10271015
'add' // replace this parameter with 'remove' or 'demote' or 'promote'
10281016
)
@@ -1075,7 +1063,7 @@ console.log('group information: ' + response)
10751063
```
10761064
### Query Metadata (participants, name, description...)
10771065
```ts
1078-
const metadata = await sock.groupMetadata(jid)
1066+
const metadata = await sock.groupMetadata(jid)
10791067
console.log(metadata.id + ', title: ' + metadata.subject + ', description: ' + metadata.desc)
10801068
```
10811069
### Join using `groupInviteMessage`
@@ -1093,7 +1081,7 @@ console.log(response)
10931081
const response = await sock.groupRequestParticipantsUpdate(
10941082
jid, // group id
10951083
1096-
'approve' // or 'reject'
1084+
'approve' // or 'reject'
10971085
)
10981086
console.log(response)
10991087
```
@@ -1184,7 +1172,7 @@ await sock.updateGroupsAddPrivacy(value)
11841172
| 90d | 7.776.000 |
11851173

11861174
```ts
1187-
const ephemeral = 86400
1175+
const ephemeral = 86400
11881176
await sock.updateDefaultDisappearingMode(ephemeral)
11891177
```
11901178

@@ -1233,14 +1221,14 @@ const sock = makeWASocket({
12331221
logger: P({ level: 'debug' }),
12341222
})
12351223
```
1236-
This will enable you to see all sorts of messages WhatsApp sends in the console.
1224+
This will enable you to see all sorts of messages WhatsApp sends in the console.
12371225

12381226
### How Whatsapp Communicate With Us
12391227

12401228
> [!TIP]
12411229
> If you want to learn whatsapp protocol, we recommend to study about Libsignal Protocol and Noise Protocol
12421230

1243-
- **Example:** Functionality to track the battery percentage of your phone. You enable logging and you'll see a message about your battery pop up in the console:
1231+
- **Example:** Functionality to track the battery percentage of your phone. You enable logging and you'll see a message about your battery pop up in the console:
12441232
```
12451233
{
12461234
"level": 10,
@@ -1269,7 +1257,7 @@ This will enable you to see all sorts of messages WhatsApp sends in the console.
12691257
},
12701258
"msg":"communication"
12711259
}
1272-
```
1260+
```
12731261

12741262
The `'frame'` is what the message received is, it has three components:
12751263
- `tag` -- what this frame is about (eg. message will have 'message')

eslint.config.mts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default defineConfig([globalIgnores([
2929
]),
3030
...base,
3131
{
32-
extends: compat.extends("plugin:prettier/recommended"),
32+
extends: [
33+
...compat.extends("plugin:prettier/recommended"),
34+
],
35+
3336

3437
plugins: {
3538
prettier,
@@ -64,7 +67,7 @@ export default defineConfig([globalIgnores([
6467
named: "never",
6568
asyncArrow: "always",
6669
}],
67-
70+
"@typescript-eslint/no-floating-promises": "error",
6871
"@typescript-eslint/no-unused-vars": ["error", {
6972
caughtErrors: "none",
7073
}],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "baileys",
33
"type": "module",
4-
"version": "7.0.0-rc.6",
4+
"version": "7.0.0-rc.9",
55
"description": "A WebSockets library for interacting with WhatsApp Web",
66
"keywords": [
77
"whatsapp",

0 commit comments

Comments
 (0)