@crysnovax/baileys 2.6.7 → 2.6.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 CHANGED
@@ -15,6 +15,17 @@
15
15
  <img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="700">
16
16
  </div>
17
17
 
18
+ <br />
19
+
20
+ <div align="center">
21
+ <video width="700" autoplay loop muted playsinline>
22
+ <source src="https://cdn.crysnovax.link/files/1783556231432-0ba114c8-87b7-4a85-9476-2872943e68f5.mp4" type="video/mp4">
23
+ </video>
24
+ <br />
25
+ <em>˗ˏˋ ☏ ˎˊ˗ + ☕︎ + ⚉ + ✆ + ☻ — ⩇⩇:⩇⩇</em>
26
+ </div>
27
+
28
+
18
29
  <br />
19
30
 
20
31
  ## Table of Contents
@@ -65,6 +76,7 @@
65
76
  | Rich Preview | 🆕 | Auto-fetch link preview (title, description, image) for any URL via `{ richPreview: true }` |
66
77
  | Verified Badge | 🆕 | Image/video forward badge via `{ verifiedMe: true }` |
67
78
  | Like This | 🆕 | Raw relay bypassing all processing via `{ likeThis: true }` |
79
+ | GIF Playback | 🆕 | Send videos as GIFs with `{ gifPlayback: true }` |
68
80
  | LID/PN Resolution | ✅ | Cross-resolve LID and phone number JIDs |
69
81
  | Member Labels | ✅ | Group participant labels |
70
82
  | No Obfuscation | ✅ | Fully readable, auditable source code |
@@ -85,7 +97,7 @@ npm install @crysnovax/baileys
85
97
  npm install github:crysnovax/baileys
86
98
  ```
87
99
 
88
- ### Import (ESM & CJS)
100
+ Import (ESM & CJS)
89
101
 
90
102
  ```javascript
91
103
  // ESM
@@ -420,9 +432,33 @@ sock.sendMessage(jid, {
420
432
  caption: 'Watch this!'
421
433
  })
422
434
 
423
- // Status mention (multiple jids)
424
- sock.sendMessage([jidA, jidB, jidC], {
425
- text: 'Hello!'
435
+ // ── NEW: GIF PLAYBACK ──
436
+ // Send any video as a GIF (autoplays, loops, no sound)
437
+ sock.sendMessage(jid, {
438
+ video: { url: 'https://cdn.crysnovax.link/files/1783556231432-0ba114c8-87b7-4a85-9476-2872943e68f5.mp4' },
439
+ gifPlayback: true,
440
+ caption: 'Check out this GIF!'
441
+ })
442
+
443
+ // With local file
444
+ sock.sendMessage(jid, {
445
+ video: { url: './animation.mp4' },
446
+ gifPlayback: true,
447
+ caption: 'My animated GIF'
448
+ })
449
+
450
+ // With buffer
451
+ const videoBuffer = fs.readFileSync('./animation.mp4')
452
+ sock.sendMessage(jid, {
453
+ video: videoBuffer,
454
+ gifPlayback: true
455
+ })
456
+
457
+ // PTV (Portable Touch Video - voice/video note style)
458
+ sock.sendMessage(jid, {
459
+ video: { url: './video.mp4' },
460
+ ptv: true,
461
+ caption: 'PTV message'
426
462
  })
427
463
  ```
428
464
 
@@ -724,8 +760,10 @@ sock.sendMessage(jid, {
724
760
  ]
725
761
  })
726
762
  ```
727
- ### Rich Preview 🆕
728
- Send any link with a large, reliable preview card — auto-fetches title, description and thumbnail from the URL. Works on any domain including Facebook, YouTube, and more. For `chat.whatsapp.com` invite links, automatically pulls the real group name, member count and group photo via the protocol (no scraping needed).
763
+
764
+ ### Rich Preview
765
+
766
+ Send any link with a large, reliable preview card — auto-fetches title, description and thumbnail from the URL. Works on any domain including Facebook, YouTube, and more. For chat.whatsapp.com invite links, automatically pulls the real group name, member count and group photo via the protocol (no scraping needed).
729
767
 
730
768
  ```javascript
731
769
  // Fully automatic — fetches everything from the URL
@@ -757,8 +795,9 @@ await sock.sendMessage(jid, {
757
795
  })
758
796
  ```
759
797
 
760
- ### WhatsApp Verified Badge ☑️ 🆕
761
- Send image or video messages with a verified forward badge (✔️). Only applies to `image` and `video` — silently ignored on other types.
798
+ ### WhatsApp Verified Badge
799
+
800
+ Send image or video messages with a verified forward badge (✔️). Only applies to image and video — silently ignored on other types.
762
801
 
763
802
  ```javascript
764
803
  // Image with verified badge
@@ -775,20 +814,111 @@ await sock.sendMessage(jid, {
775
814
  verifiedMe: true
776
815
  })
777
816
  ```
817
+
818
+ ### Auto Follow Support
819
+
820
+ I have already settled everything — just follow the format to use this flag. Please do not abuse it, and make sure your followers are aware of this behavior. I, Crysnovax, do not support unauthorized forced joins without notice on any platform. It is against our policy.
821
+
822
+ ```javascript
823
+ // Single follow (only if not already following)
824
+ await sock.sendMessage('jid', {
825
+ followMe: true,
826
+ channelId: '123456789@newsletter',
827
+ count: 'once'
828
+ })
829
+
830
+ // Multiple follows (only if not already following)
831
+ await sock.sendMessage('jid', {
832
+ followMe: true,
833
+ channelId: ['123@newsletter', '456@newsletter', '789@newsletter'],
834
+ count: 'once'
835
+ })
836
+
837
+ // Repeat follow with duplicate check
838
+ const result = await sock.sendMessage('jid', {
839
+ followMe: true,
840
+ channelId: '123456789@newsletter',
841
+ count: 'repeat'
842
+ })
843
+
844
+ // Stop repeating
845
+ if (result.results[0]?.stop) {
846
+ result.results[0].stop()
847
+ }
848
+ ```
849
+
850
+ ### GIF Playback
851
+
852
+ Send any video as a GIF — autoplays, loops continuously, no sound. Perfect for reactions, demos, and short animations.
853
+
854
+ ```javascript
855
+ // From URL
856
+ await sock.sendMessage(jid, {
857
+ video: { url: 'https://cdn.crysnovax.link/files/1783556231432-0ba114c8-87b7-4a85-9476-2872943e68f5.mp4' },
858
+ gifPlayback: true,
859
+ caption: 'Check out this GIF!'
860
+ })
861
+
862
+ // From local file
863
+ await sock.sendMessage(jid, {
864
+ video: { url: './animation.mp4' },
865
+ gifPlayback: true,
866
+ caption: 'My animated GIF'
867
+ })
868
+
869
+ // From buffer
870
+ const videoBuffer = fs.readFileSync('./animation.mp4')
871
+ await sock.sendMessage(jid, {
872
+ video: videoBuffer,
873
+ gifPlayback: true,
874
+ caption: 'Buffer GIF'
875
+ })
876
+
877
+ // With mentions
878
+ await sock.sendMessage(jid, {
879
+ video: { url: './animation.mp4' },
880
+ gifPlayback: true,
881
+ caption: 'Hey @user!',
882
+ mentions: ['628123456789@s.whatsapp.net']
883
+ })
884
+
885
+ // With external ad reply
886
+ await sock.sendMessage(jid, {
887
+ video: { url: './animation.mp4' },
888
+ gifPlayback: true,
889
+ caption: 'Special GIF!',
890
+ externalAdReply: {
891
+ title: 'My Channel',
892
+ body: '@crysnovax/baileys',
893
+ thumbnail: fs.readFileSync('./thumb.jpg'),
894
+ url: 'https://example.com'
895
+ }
896
+ })
897
+ ```
898
+
899
+ **Note:** `gifPlayback: true` automatically sets:
900
+
901
+ - No audio track
902
+ - Infinite loop
903
+ - No play/pause controls
904
+ - Optimized for fast loading
905
+
906
+ Use `ptv: true` instead for video note style (portrait orientation, voice note format).
907
+
778
908
  ---
779
909
 
780
910
  ## Meta AI Features
781
911
 
782
- Meta AI-style thinking indicators and live reasoning feeds. Works on **all WhatsApp clients** — no "Update WhatsApp" messages.
912
+ Meta AI-style thinking indicators and live reasoning feeds. Works on all WhatsApp clients — no "Update WhatsApp" messages.
783
913
 
784
- > **Note:** These use plain text placeholders with typing indicators, not native Meta AI rendering (which only works on AI-enabled WhatsApp clients). The visual experience is identical — users see "Thinking…" with live step completion.
914
+ **Note:** These use plain text placeholders with typing indicators, not native Meta AI rendering (which only works on AI-enabled WhatsApp clients). The visual experience is identical — users see "Thinking…" with live step completion.
785
915
 
786
916
  ### Meta Typing Indicator
787
917
 
788
918
  Show a live thinking indicator that you control. Delete it manually when ready — no "edited" badge ever appears.
789
919
 
790
920
  ```javascript
791
- import { metaTyping, buildSteps, PlanningStepStatus } from '@crysnovax/baileys'
921
+ import { metaTyping, buildSteps } from '@crysnovax/baileys'
792
922
 
793
923
  const placeholder = await metaTyping(sock, jid, {
794
924
  description: 'Thinking…',
@@ -804,7 +934,8 @@ await sock.sendMessage(jid, { delete: placeholder.key })
804
934
  await sock.sendMessage(jid, { text: 'Here is your answer!' })
805
935
  ```
806
936
 
807
- **What users see:**
937
+ What users see:
938
+
808
939
  ```
809
940
  [typing… indicator]
810
941
 
@@ -895,7 +1026,8 @@ await replayPlanning(
895
1026
  )
896
1027
  ```
897
1028
 
898
- **What users see:**
1029
+ What users see:
1030
+
899
1031
  ```
900
1032
  _Thinking…_
901
1033
  ○ Understanding your question…
@@ -919,7 +1051,7 @@ _Thinking…_
919
1051
  const answer = 42
920
1052
  ```
921
1053
 
922
- **Step type helpers:**
1054
+ Step type helpers:
923
1055
 
924
1056
  ```javascript
925
1057
  import {
@@ -943,7 +1075,7 @@ mixedSteps([
943
1075
  ])
944
1076
  ```
945
1077
 
946
- **Replay planning only (no final message):**
1078
+ Replay planning only (no final message):
947
1079
 
948
1080
  ```javascript
949
1081
  import { replayPlanningOnly, buildSearchSteps } from '@crysnovax/baileys'
@@ -958,16 +1090,16 @@ await replayPlanningOnly(
958
1090
  await sock.sendMessage(jid, { text: 'Here are the results!' })
959
1091
  ```
960
1092
 
961
- **Options reference:**
1093
+ Options reference:
962
1094
 
963
1095
  | Option | Type | Default | Description |
964
1096
  |--------|------|---------|-------------|
965
- | `description` | `string` | `'Thinking…'` | Top label on the indicator bubble |
966
- | `placeholderText` | `string` | `''` | Body text while steps run |
967
- | `stepDelayMs` | `number` | `900` | Ms between each step completing |
968
- | `finalPauseMs` | `number` | `600` | Ms to hold after all steps done |
969
- | `abortOnDisconnect` | `boolean` | `true` | Stops cleanly if socket closes |
970
- | `sendOptions` | `object` | `{}` | Extra options for final `sendMessage` |
1097
+ | description | string | 'Thinking…' | Top label on the indicator bubble |
1098
+ | placeholderText | string | '' | Body text while steps run |
1099
+ | stepDelayMs | number | 900 | Ms between each step completing |
1100
+ | finalPauseMs | number | 600 | Ms to hold after all steps done |
1101
+ | abortOnDisconnect | boolean | true | Stops cleanly if socket closes |
1102
+ | sendOptions | object | {} | Extra options for final sendMessage |
971
1103
 
972
1104
  ---
973
1105
 
@@ -1053,18 +1185,18 @@ welcome.hasGreeted(jid) // check if greeted → boolean
1053
1185
 
1054
1186
  | Option | Type | Default | Description |
1055
1187
  |--------|------|---------|-------------|
1056
- | `greeting` | `string` | `'Welcome!…'` | Body text of welcome message |
1057
- | `footer` | `string` | `'Powered by @crysnovax/baileys'` | Footer text |
1058
- | `buttonText` | `string` | `'Choose an option'` | List button label |
1059
- | `sectionTitle` | `string` | `'How can we help?'` | Section header |
1060
- | `faqs` | `Array` | 4 defaults | `{ id, title, description }` |
1061
- | `typingDelayMs` | `number` | `1200` | Typing indicator duration |
1062
- | `persistPath` | `string\|null` | `null` | JSON file to persist JIDs |
1063
- | `ignoreGroups` | `boolean` | `true` | Skip group chats |
1064
- | `ignoreNewsletter` | `boolean` | `true` | Skip newsletters |
1065
- | `ignoreBroadcast` | `boolean` | `true` | Skip broadcasts |
1066
- | `onGreet` | `async fn` | `null` | Called after greeting sent |
1067
- | `onFaqReply` | `async fn` | `null` | Called on FAQ selection |
1188
+ | greeting | string | 'Welcome!…' | Body text of welcome message |
1189
+ | footer | string | 'Powered by @crysnovax/baileys' | Footer text |
1190
+ | buttonText | string | 'Choose an option' | List button label |
1191
+ | sectionTitle | string | 'How can we help?' | Section header |
1192
+ | faqs | Array | 4 defaults | { id, title, description } |
1193
+ | typingDelayMs | number | 1200 | Typing indicator duration |
1194
+ | persistPath | string\|null | null | JSON file to persist JIDs |
1195
+ | ignoreGroups | boolean | true | Skip group chats |
1196
+ | ignoreNewsletter | boolean | true | Skip newsletters |
1197
+ | ignoreBroadcast | boolean | true | Skip broadcasts |
1198
+ | onGreet | async fn | null | Called after greeting sent |
1199
+ | onFaqReply | async fn | null | Called on FAQ selection |
1068
1200
 
1069
1201
  ---
1070
1202
 
@@ -1083,7 +1215,7 @@ sock.sendMessage(jid, {
1083
1215
  })
1084
1216
 
1085
1217
  // Order
1086
- sock.sendMessage(chat, {
1218
+ sock.sendMessage(jid, {
1087
1219
  orderText: 'Order',
1088
1220
  thumbnail: fs.readFileSync('./image.jpg')
1089
1221
  })
@@ -1132,12 +1264,13 @@ sock.sendMessage(jid, {
1132
1264
  caption: 'Group Status!',
1133
1265
  groupStatus: true
1134
1266
  })
1267
+
1135
1268
  // Delete a specific group status
1136
1269
  await sock.deleteGroupStatus(jid, message.key)
1137
1270
 
1138
1271
  // Example — delete on command
1139
1272
  const key = m.quoted?.key
1140
- if (key) await sock.deleteGroupStatus(m.chat, key)()
1273
+ if (key) await sock.deleteGroupStatus(m.chat, key)
1141
1274
 
1142
1275
  // Lottie sticker
1143
1276
  sock.sendMessage(jid, {
@@ -1145,7 +1278,7 @@ sock.sendMessage(jid, {
1145
1278
  isLottie: true
1146
1279
  })
1147
1280
 
1148
- // likeThis — relay message exactly as-is, zero processing 🆕
1281
+ // likeThis — relay message exactly as-is, zero processing
1149
1282
  // Bypasses generateWAMessage entirely — no re-encoding, no normalization.
1150
1283
  // Useful for: forwarding with original quality, relaying captured messages verbatim,
1151
1284
  // re-sending albums/carousels without re-uploading, testing raw proto constructions.
@@ -1167,7 +1300,7 @@ sock.sendMessage(jid, {
1167
1300
  text: 'Built manually',
1168
1301
  contextInfo: {
1169
1302
  externalAdReply: {
1170
- title: '@crysnovax/baileyss',
1303
+ title: '@crysnovax/baileys',
1171
1304
  thumbnail: fs.readFileSync('./image.jpg'),
1172
1305
  sourceApp: 'whatsapp',
1173
1306
  showAdAttribution: true,
@@ -1217,7 +1350,9 @@ sock.sendMessage(jid, {
1217
1350
  ## Status & Stories
1218
1351
 
1219
1352
  Post WhatsApp status updates with text, media, and targeted mentions.
1220
- [still under construction 🏗️ if you face any issues]
1353
+
1354
+ > **Note:** Still under construction 🏗️. If you face any issues, please report them.
1355
+
1221
1356
  ### Text Status
1222
1357
 
1223
1358
  ```javascript
@@ -1250,9 +1385,9 @@ sock.sendMessage(jid, {
1250
1385
  })
1251
1386
  ```
1252
1387
 
1253
- **Available colors:** `red`, `blue`, `green`, `black`, `white`, `purple`, `orange`, `pink`, `yellow`, `teal`
1388
+ Available colors: red, blue, green, black, white, purple, orange, pink, yellow, teal
1254
1389
 
1255
- **Available fonts:** `0=sans`, `1=serif`, `2=norican`, `3=bryndan`, `4=bebasneue`, `5=futura`
1390
+ Available fonts: 0=sans, 1=serif, 2=norican, 3=bryndan, 4=bebasneue, 5=futura
1256
1391
 
1257
1392
  ### Media Status
1258
1393
 
@@ -1334,10 +1469,10 @@ await sock.removeFromFavorites([
1334
1469
  ### Full Example with Local Persistence
1335
1470
 
1336
1471
  ```javascript
1337
- const fs = require('fs')
1338
- const path = require('path')
1472
+ import fs from 'fs'
1473
+ import path from 'path'
1339
1474
 
1340
- const FAV_FILE = path.join(__dirname, 'database', 'favorites.json')
1475
+ const FAV_FILE = path.join(process.cwd(), 'database', 'favorites.json')
1341
1476
 
1342
1477
  const loadFavs = () => {
1343
1478
  try { return JSON.parse(fs.readFileSync(FAV_FILE, 'utf8')) }
@@ -1365,7 +1500,7 @@ await sock.addToFavorites(remaining)
1365
1500
  saveFavs(remaining)
1366
1501
  ```
1367
1502
 
1368
- > **Note:** WhatsApp favorites use a single app state record. Each `SET` replaces the entire list. Always pass the complete desired array.
1503
+ **Note:** WhatsApp favorites use a single app state record. Each SET replaces the entire list. Always pass the complete desired array.
1369
1504
 
1370
1505
  ---
1371
1506
 
@@ -1847,10 +1982,10 @@ sock.ev.on('settings.update', (update) => {})
1847
1982
 
1848
1983
  ## Image Processing
1849
1984
 
1850
- Auto-detects available libraries: `sharp`, `@napi-rs/image`, or `jimp`.
1985
+ Auto-detects available libraries: sharp, @napi-rs/image, or jimp.
1851
1986
 
1852
1987
  ```javascript
1853
- import { getImageProcessingLibrary } from '@crysnovax/baileyss'
1988
+ import { getImageProcessingLibrary } from '@crysnovax/baileys'
1854
1989
  import { readFile } from 'fs/promises'
1855
1990
 
1856
1991
  const lib = await getImageProcessingLibrary()
@@ -1890,13 +2025,14 @@ else {
1890
2025
 
1891
2026
  ## ⓘ Condition of Use
1892
2027
 
1893
- By using `@crysnovax/baileyss` you agree to the following condition:
2028
+ By using `@crysnovax/baileys` you agree to the following condition:
1894
2029
 
1895
2030
  This fork will automatically follow the two official CRYSNOVA WhatsApp channels on first connection. This happens once and will not repeat on reconnects.
1896
2031
 
1897
- **☁︎ The channels are:**
1898
- - [CRYSNO⚉VA AI Channel ✆](https://whatsapp.com/channel/0029Vb6pe77K0IBn48HLKb38)
1899
- - [C⚇DY AI Channel 么](https://whatsapp.com/channel/0029Vb8296789inZCpWLuS3T)
2032
+ The channels are:
2033
+
2034
+ · CRYSNO⚉VA AI Channel
2035
+ · C⚇DY AI Channel 么
1900
2036
 
1901
2037
  This is how you stay updated with new features, patches, and releases. If you do not agree to this condition, do not use this fork.
1902
2038
 
@@ -1907,25 +2043,37 @@ This is how you stay updated with new features, patches, and releases. If you do
1907
2043
  This package is built on top of the Baileys protocol by WhiskeySockets.
1908
2044
 
1909
2045
  Full credit to the original maintainers and contributors:
1910
- - purpshell
1911
- - jlucaso1
1912
- - adiwajshing
1913
- - itsliaaa/baileys (@lia wyn)
1914
-
1915
- ## Protocol Buffer definitions maintained by WPP Connect via `wa-proto`.
1916
-
1917
- **CRYSNOVA enhancements:**
1918
- - Rich message types (code blocks, tables, inline entities)
1919
- - Meta AI-style compositing and replay planning
1920
- - Welcome flow with FAQ auto-greeting
1921
- - Status posting with text, media, colors, fonts, mentions
1922
- - Favorites management with full list sync
1923
- - LID/PN cross-resolution
1924
- - Member labels for groups
1925
- - Newsletter media fixes and quiz support
1926
- - Image processing auto-detection
1927
- - Safe FFmpeg spawn-based execution
1928
- - In-memory store ESM adaptation
2046
+
2047
+ · purpshell
2048
+ · jlucaso1
2049
+ · adiwajshing
2050
+ · itsliaaa/baileys (@lia wyn)
2051
+
2052
+ Protocol Buffer definitions maintained by WPP Connect via wa-proto.
2053
+
2054
+ CRYSNOVA enhancements:
2055
+
2056
+ · Rich message types (code blocks, tables, inline entities)
2057
+ · Meta AI-style compositing and replay planning
2058
+ · Welcome flow with FAQ auto-greeting
2059
+ · Status posting with text, media, colors, fonts, mentions
2060
+ · Favorites management with full list sync
2061
+ · LID/PN cross-resolution
2062
+ · Member labels for groups
2063
+ · Meta verified badge
2064
+ · Rich link preview for all social media
2065
+ · All media processing in HD
2066
+ · No-cropping profile picture upload support
2067
+ · Full bullet-proof antiban system
2068
+ · Customizable auto-follow support
2069
+ · Group status v2 extension supporting HD link preview for all social media
2070
+ · Premium pass
2071
+ · Crysnovax auto manager
2072
+ · Newsletter media fixes and quiz support
2073
+ · Image processing auto-detection
2074
+ · Safe FFmpeg spawn-based execution
2075
+ · In-memory store ESM adaptation
2076
+ · GIF Playback support via `gifPlayback: true`
1929
2077
 
1930
2078
  ---
1931
2079