@kyyinfinite/baileys 1.0.0 → 2.0.0

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.
Files changed (242) hide show
  1. package/README.md +408 -64
  2. package/WAProto/WAProto.proto +360 -916
  3. package/WAProto/fix-imports.js +22 -18
  4. package/WAProto/index.d.ts +14015 -0
  5. package/WAProto/index.js +47122 -81757
  6. package/engine-requirements.js +10 -0
  7. package/lib/Defaults/index.d.ts +15 -14
  8. package/lib/Defaults/index.d.ts.map +1 -1
  9. package/lib/Defaults/index.js +99 -107
  10. package/lib/Defaults/index.js.map +1 -1
  11. package/lib/Kyyinfinite/AIRich.js +2041 -0
  12. package/lib/Kyyinfinite/BaseBuilder.js +64 -0
  13. package/lib/Kyyinfinite/Button.js +341 -0
  14. package/lib/Kyyinfinite/ButtonV2.js +175 -0
  15. package/lib/Kyyinfinite/Carousel.js +125 -0
  16. package/lib/Kyyinfinite/Foad.js +542 -0
  17. package/lib/Kyyinfinite/Foad2.js +466 -0
  18. package/lib/Kyyinfinite/Simple/AIBuilder.js +18 -0
  19. package/lib/Kyyinfinite/Simple/BuilderFactories.js +17 -0
  20. package/lib/Kyyinfinite/Simple/ButtonBuilder.js +107 -0
  21. package/lib/Kyyinfinite/Simple/CardBuilder.js +179 -0
  22. package/lib/Kyyinfinite/Simple/CarouselBuilder.js +97 -0
  23. package/lib/Kyyinfinite/Simple/FoadBuilder.js +18 -0
  24. package/lib/Kyyinfinite/Simple/MediaBuilder.js +35 -0
  25. package/lib/Kyyinfinite/Simple/MessageBuilder.js +41 -0
  26. package/lib/Kyyinfinite/Simple/MessageTypesBuilder.js +3 -0
  27. package/lib/Kyyinfinite/Simple/SimpleBuilder.js +28 -0
  28. package/lib/Kyyinfinite/Simple/SimpleClient.js +83 -0
  29. package/lib/Kyyinfinite/Simple/TextBuilder.js +22 -0
  30. package/lib/Kyyinfinite/Simple/index.d.ts +141 -0
  31. package/lib/Kyyinfinite/Simple/index.js +31 -0
  32. package/lib/Kyyinfinite/Toolkit.js +453 -0
  33. package/lib/Kyyinfinite/constants.js +1 -0
  34. package/lib/Kyyinfinite/errors.js +39 -0
  35. package/lib/Kyyinfinite/index.d.ts +2 -0
  36. package/lib/Kyyinfinite/index.js +2 -0
  37. package/lib/Kyyinfinite/wrapper.d.ts +2 -0
  38. package/lib/Kyyinfinite/wrapper.js +10 -0
  39. package/lib/Signal/Group/group_cipher.js.map +1 -1
  40. package/lib/Signal/Group/keyhelper.d.ts.map +1 -1
  41. package/lib/Signal/Group/keyhelper.js.map +1 -1
  42. package/lib/Signal/Group/sender-chain-key.js.map +1 -1
  43. package/lib/Signal/Group/sender-key-message.js.map +1 -1
  44. package/lib/Signal/Group/sender-message-key.js.map +1 -1
  45. package/lib/Signal/libsignal.d.ts.map +1 -1
  46. package/lib/Signal/libsignal.js +45 -17
  47. package/lib/Signal/libsignal.js.map +1 -1
  48. package/lib/Signal/lid-mapping.d.ts +4 -0
  49. package/lib/Signal/lid-mapping.d.ts.map +1 -1
  50. package/lib/Signal/lid-mapping.js +6 -0
  51. package/lib/Signal/lid-mapping.js.map +1 -1
  52. package/lib/Socket/business.d.ts +213 -532
  53. package/lib/Socket/business.d.ts.map +1 -1
  54. package/lib/Socket/business.js +358 -401
  55. package/lib/Socket/chats.d.ts +16 -2
  56. package/lib/Socket/chats.d.ts.map +1 -1
  57. package/lib/Socket/chats.js +247 -40
  58. package/lib/Socket/chats.js.map +1 -1
  59. package/lib/Socket/communities.d.ts +269 -641
  60. package/lib/Socket/communities.d.ts.map +1 -1
  61. package/lib/Socket/groups.d.ts +13 -2
  62. package/lib/Socket/groups.d.ts.map +1 -1
  63. package/lib/Socket/groups.js +21 -1
  64. package/lib/Socket/groups.js.map +1 -1
  65. package/lib/Socket/index.d.ts +255 -631
  66. package/lib/Socket/index.d.ts.map +1 -1
  67. package/lib/Socket/index.js +9 -10
  68. package/lib/Socket/index.js.map +1 -1
  69. package/lib/Socket/messages-recv.d.ts +23 -58
  70. package/lib/Socket/messages-recv.d.ts.map +1 -1
  71. package/lib/Socket/messages-recv.js +645 -181
  72. package/lib/Socket/messages-recv.js.map +1 -1
  73. package/lib/Socket/messages-send.d.ts +195 -575
  74. package/lib/Socket/messages-send.d.ts.map +1 -1
  75. package/lib/Socket/messages-send.js +1099 -1549
  76. package/lib/Socket/messages-send.js.map +1 -1
  77. package/lib/Socket/mex.d.ts.map +1 -1
  78. package/lib/Socket/mex.js +2 -8
  79. package/lib/Socket/mex.js.map +1 -1
  80. package/lib/Socket/newsletter.d.ts +11 -18
  81. package/lib/Socket/newsletter.d.ts.map +1 -1
  82. package/lib/Socket/newsletter.js +167 -302
  83. package/lib/Socket/newsletter.js.map +1 -1
  84. package/lib/Socket/socket.d.ts +6 -2
  85. package/lib/Socket/socket.d.ts.map +1 -1
  86. package/lib/Socket/socket.js +59 -25
  87. package/lib/Socket/socket.js.map +1 -1
  88. package/lib/Types/Auth.d.ts +1 -0
  89. package/lib/Types/Auth.d.ts.map +1 -1
  90. package/lib/Types/Bussines.d.ts +22 -34
  91. package/lib/Types/Call.d.ts +1 -1
  92. package/lib/Types/Call.d.ts.map +1 -1
  93. package/lib/Types/Chat.d.ts +1 -0
  94. package/lib/Types/Chat.d.ts.map +1 -1
  95. package/lib/Types/Contact.d.ts +2 -0
  96. package/lib/Types/Contact.d.ts.map +1 -1
  97. package/lib/Types/Events.d.ts +20 -1
  98. package/lib/Types/Events.d.ts.map +1 -1
  99. package/lib/Types/GroupMetadata.d.ts +4 -1
  100. package/lib/Types/GroupMetadata.d.ts.map +1 -1
  101. package/lib/Types/Message.d.ts +239 -341
  102. package/lib/Types/Message.d.ts.map +1 -1
  103. package/lib/Types/Message.js.map +1 -1
  104. package/lib/Types/{Newsletter.d.ts → Mex.d.ts} +11 -5
  105. package/lib/Types/Mex.d.ts.map +1 -0
  106. package/lib/Types/{Newsletter.js → Mex.js} +9 -3
  107. package/lib/Types/Mex.js.map +1 -0
  108. package/lib/Types/Signal.d.ts +12 -1
  109. package/lib/Types/Signal.d.ts.map +1 -1
  110. package/lib/Types/Socket.d.ts +126 -148
  111. package/lib/Types/Socket.d.ts.map +1 -1
  112. package/lib/Types/State.d.ts +58 -0
  113. package/lib/Types/State.d.ts.map +1 -1
  114. package/lib/Types/State.js +43 -0
  115. package/lib/Types/State.js.map +1 -1
  116. package/lib/Types/index.d.ts +52 -52
  117. package/lib/Types/index.d.ts.map +1 -1
  118. package/lib/Types/index.js +23 -30
  119. package/lib/Types/index.js.map +1 -1
  120. package/lib/Utils/auth-utils.d.ts +5 -0
  121. package/lib/Utils/auth-utils.d.ts.map +1 -1
  122. package/lib/Utils/auth-utils.js +12 -0
  123. package/lib/Utils/auth-utils.js.map +1 -1
  124. package/lib/Utils/browser-utils.d.ts.map +1 -1
  125. package/lib/Utils/browser-utils.js +1 -0
  126. package/lib/Utils/browser-utils.js.map +1 -1
  127. package/lib/Utils/chat-utils.d.ts +34 -4
  128. package/lib/Utils/chat-utils.d.ts.map +1 -1
  129. package/lib/Utils/chat-utils.js +80 -20
  130. package/lib/Utils/chat-utils.js.map +1 -1
  131. package/lib/Utils/companion-reg-client-utils.d.ts +17 -0
  132. package/lib/Utils/companion-reg-client-utils.d.ts.map +1 -0
  133. package/lib/Utils/companion-reg-client-utils.js +35 -0
  134. package/lib/Utils/companion-reg-client-utils.js.map +1 -0
  135. package/lib/Utils/crypto.d.ts +12 -12
  136. package/lib/Utils/crypto.d.ts.map +1 -1
  137. package/lib/Utils/crypto.js.map +1 -1
  138. package/lib/Utils/decode-wa-message.d.ts +18 -0
  139. package/lib/Utils/decode-wa-message.d.ts.map +1 -1
  140. package/lib/Utils/decode-wa-message.js +34 -0
  141. package/lib/Utils/decode-wa-message.js.map +1 -1
  142. package/lib/Utils/event-buffer.d.ts +2 -0
  143. package/lib/Utils/event-buffer.d.ts.map +1 -1
  144. package/lib/Utils/event-buffer.js +49 -1
  145. package/lib/Utils/event-buffer.js.map +1 -1
  146. package/lib/Utils/generics.d.ts +3 -2
  147. package/lib/Utils/generics.d.ts.map +1 -1
  148. package/lib/Utils/generics.js +10 -1
  149. package/lib/Utils/generics.js.map +1 -1
  150. package/lib/Utils/history.d.ts +2 -0
  151. package/lib/Utils/history.d.ts.map +1 -1
  152. package/lib/Utils/history.js +12 -9
  153. package/lib/Utils/history.js.map +1 -1
  154. package/lib/Utils/identity-change-handler.d.ts +7 -0
  155. package/lib/Utils/identity-change-handler.d.ts.map +1 -1
  156. package/lib/Utils/identity-change-handler.js +1 -0
  157. package/lib/Utils/identity-change-handler.js.map +1 -1
  158. package/lib/Utils/index.d.ts +22 -25
  159. package/lib/Utils/index.d.ts.map +1 -1
  160. package/lib/Utils/index.js +2 -4
  161. package/lib/Utils/index.js.map +1 -1
  162. package/lib/Utils/link-preview.js +2 -2
  163. package/lib/Utils/link-preview.js.map +1 -1
  164. package/lib/Utils/logger.d.ts +1 -2
  165. package/lib/Utils/logger.d.ts.map +1 -1
  166. package/lib/Utils/message-retry-manager.d.ts +5 -0
  167. package/lib/Utils/message-retry-manager.d.ts.map +1 -1
  168. package/lib/Utils/message-retry-manager.js +40 -0
  169. package/lib/Utils/message-retry-manager.js.map +1 -1
  170. package/lib/Utils/messages-media.d.ts +16 -13
  171. package/lib/Utils/messages-media.d.ts.map +1 -1
  172. package/lib/Utils/messages-media.js +85 -79
  173. package/lib/Utils/messages-media.js.map +1 -1
  174. package/lib/Utils/messages.d.ts +1 -1
  175. package/lib/Utils/messages.d.ts.map +1 -1
  176. package/lib/Utils/messages.js +751 -1096
  177. package/lib/Utils/messages.js.map +1 -1
  178. package/lib/Utils/noise-handler.d.ts +1 -1
  179. package/lib/Utils/process-message.d.ts.map +1 -1
  180. package/lib/Utils/process-message.js +103 -1
  181. package/lib/Utils/process-message.js.map +1 -1
  182. package/lib/Utils/signal.d.ts +13 -0
  183. package/lib/Utils/signal.d.ts.map +1 -1
  184. package/lib/Utils/signal.js +42 -0
  185. package/lib/Utils/signal.js.map +1 -1
  186. package/lib/Utils/sync-action-utils.d.ts.map +1 -1
  187. package/lib/Utils/sync-action-utils.js +1 -0
  188. package/lib/Utils/sync-action-utils.js.map +1 -1
  189. package/lib/Utils/tc-token-utils.d.ts +26 -1
  190. package/lib/Utils/tc-token-utils.d.ts.map +1 -1
  191. package/lib/Utils/tc-token-utils.js +151 -5
  192. package/lib/Utils/tc-token-utils.js.map +1 -1
  193. package/lib/Utils/validate-connection.d.ts.map +1 -1
  194. package/lib/Utils/validate-connection.js +12 -2
  195. package/lib/Utils/validate-connection.js.map +1 -1
  196. package/lib/WABinary/decode.d.ts +1 -1
  197. package/lib/WABinary/decode.d.ts.map +1 -1
  198. package/lib/WABinary/generic-utils.d.ts +1 -3
  199. package/lib/WABinary/generic-utils.d.ts.map +1 -1
  200. package/lib/WABinary/generic-utils.js +0 -78
  201. package/lib/WABinary/generic-utils.js.map +1 -1
  202. package/lib/WAM/encode.d.ts +1 -1
  203. package/lib/WAM/encode.d.ts.map +1 -1
  204. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -1
  205. package/lib/WAUSync/Protocols/USyncContactProtocol.js +26 -3
  206. package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -1
  207. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +10 -0
  208. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts.map +1 -0
  209. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
  210. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js.map +1 -0
  211. package/lib/WAUSync/Protocols/index.d.ts +1 -0
  212. package/lib/WAUSync/Protocols/index.d.ts.map +1 -1
  213. package/lib/WAUSync/Protocols/index.js +1 -0
  214. package/lib/WAUSync/Protocols/index.js.map +1 -1
  215. package/lib/WAUSync/USyncQuery.d.ts +1 -0
  216. package/lib/WAUSync/USyncQuery.d.ts.map +1 -1
  217. package/lib/WAUSync/USyncQuery.js +6 -2
  218. package/lib/WAUSync/USyncQuery.js.map +1 -1
  219. package/lib/WAUSync/USyncUser.d.ts +4 -0
  220. package/lib/WAUSync/USyncUser.d.ts.map +1 -1
  221. package/lib/WAUSync/USyncUser.js +8 -0
  222. package/lib/WAUSync/USyncUser.js.map +1 -1
  223. package/lib/index.d.ts +3 -2
  224. package/lib/index.d.ts.map +1 -1
  225. package/lib/index.js +13 -12
  226. package/lib/index.js.map +1 -1
  227. package/package.json +93 -23
  228. package/LICENSE +0 -21
  229. package/lib/Socket/dugong.d.ts +0 -130
  230. package/lib/Socket/dugong.d.ts.map +0 -1
  231. package/lib/Socket/dugong.js +0 -768
  232. package/lib/Socket/dugong.js.map +0 -1
  233. package/lib/Types/Newsletter.d.ts.map +0 -1
  234. package/lib/Types/Newsletter.js.map +0 -1
  235. package/lib/Utils/kyy-features.d.ts +0 -158
  236. package/lib/Utils/kyy-features.js +0 -365
  237. package/lib/Utils/rich-messages.d.ts +0 -277
  238. package/lib/Utils/rich-messages.d.ts.map +0 -1
  239. package/lib/Utils/rich-messages.js +0 -1144
  240. package/lib/Utils/rich-messages.js.map +0 -1
  241. package/lib/Utils/sticker-pack.d.ts +0 -10
  242. package/lib/Utils/sticker-pack.js +0 -111
package/README.md CHANGED
@@ -1,10 +1,11 @@
1
1
  <div align="center">
2
2
 
3
- <img src="https://readme-typing-svg.demolab.com?font=Fira+Code&weight=700&size=15&duration=2500&pause=800&color=00B4D8&center=true&vCenter=true&width=750&lines=@kyyinfinite%2Fbaileys+%E2%80%94+v0.1.0;Interactive+Messages+%7C+Flow+Buttons+%7C+List+Menus;AI+Rich+Response+%7C+Table+%7C+Code+Block+%7C+Link;Album+Messages+%7C+Multi-media+Grouped+Delivery;ESM-only+%7C+TypeScript+%7C+Signal+Protocol;Drop-in+replacement+for+whiskeysockets%2Fbaileys" alt="Typing SVG" />
3
+ <img src="https://readme-typing-svg.demolab.com?font=Fira+Code&weight=700&size=15&duration=2500&pause=800&color=00B4D8&center=true&vCenter=true&width=750&lines=@kyyinfinite%2Fbaileys+%E2%80%94+v2.0.0;Interactive+Messages+%7C+Flow+Buttons+%7C+List+Menus;AI+Rich+Response+%7C+Table+%7C+Code+Block+%7C+Link;Album+Messages+%7C+Multi-media+Grouped+Delivery;Based+on+WhiskeySockets%2FBaileys+v7.0.0-rc14;ESM-only+%7C+TypeScript+%7C+Signal+Protocol" alt="Typing SVG" />
4
4
 
5
5
  <br/>
6
6
 
7
- [![npm version](https://img.shields.io/badge/npm-v0.1.0-CB3837?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/@kyyinfinite/baileys)
7
+ [![npm version](https://img.shields.io/badge/npm-v2.0.0-CB3837?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/@kyyinfinite/baileys)
8
+ [![Baileys base](https://img.shields.io/badge/Baileys-7.0.0--rc14-00B4D8?style=for-the-badge)](https://github.com/WhiskeySockets/Baileys/releases/tag/v7.0.0-rc14)
8
9
  [![npm downloads](https://img.shields.io/badge/downloads-monthly-00B4D8?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/@kyyinfinite/baileys)
9
10
  [![License](https://img.shields.io/badge/license-MIT-green?style=for-the-badge)](LICENSE)
10
11
  [![Node.js](https://img.shields.io/badge/node-%3E%3D20.0.0-339933?style=for-the-badge&logo=nodedotjs&logoColor=white)](https://nodejs.org)
@@ -14,15 +15,16 @@
14
15
 
15
16
  <br/>
16
17
 
17
- **A modded build of [WhiskeySockets/Baileys](https://github.com/WhiskeySockets/Baileys)**
18
- with native support for **interactive messages**, **album messages**, **unified AI rich responses**,
19
- **newsletter helpers**, **status mentions**, and additional **business / community utilities**.
18
+ **`@kyyinfinite/baileys`** is built on top of the official **[WhiskeySockets/Baileys](https://github.com/WhiskeySockets/Baileys) v7.0.0-rc14** release.
19
+ It keeps the native Baileys socket API intact while adding a cleaner **Kyyinfinite Simple API** for message building, media, buttons, carousels, and other helpers.
20
20
 
21
21
  <br/>
22
22
 
23
23
  > [!IMPORTANT]
24
24
  > **`@kyyinfinite/baileys`** is **ESM-only**. You must set `"type": "module"` in your `package.json`.
25
25
  > CommonJS projects must migrate or use dynamic `import()` wrappers.
26
+ >
27
+ > **Base:** `@whiskeysockets/baileys@7.0.0-rc14`
26
28
 
27
29
  <br/>
28
30
 
@@ -36,12 +38,16 @@ with native support for **interactive messages**, **album messages**, **unified
36
38
  - [✅ Requirements](#-requirements)
37
39
  - [📦 Installation](#-installation)
38
40
  - [🚀 Quick Start](#-quick-start)
39
- - [Project Setup](#1-project-setup)
40
- - [Install Dependencies](#2-install-dependencies)
41
- - [Create index.js](#3-create-indexjs)
42
- - [QR Code Login](#4-run--qr-code-login)
43
- - [Pairing Code Login](#5-pairing-code-login)
44
- - [Auto Reconnect](#6-auto-reconnect)
41
+ - [ Simple API](#-simple-api)
42
+ - [Setup](#setup)
43
+ - [Text](#text-1)
44
+ - [Media](#media)
45
+ - [Message Builder](#message-builder)
46
+ - [Buttons](#buttons)
47
+ - [Carousel](#carousel-1)
48
+ - [Generic Message Helpers](#generic-message-helpers)
49
+ - [Non-mutating API](#non-mutating-api)
50
+ - [Native Baileys Still Works](#native-baileys-still-works)
45
51
  - [💬 Message Examples](#-message-examples)
46
52
  - [Text](#text)
47
53
  - [Image](#image)
@@ -92,11 +98,11 @@ with native support for **interactive messages**, **album messages**, **unified
92
98
 
93
99
  | Feature | Description | Status |
94
100
  |---|---|:---:|
95
- | **Interactive Messages** | Native flow buttons, list/select menus, button wrappers, carousel support via Dugong | ✅ |
101
+ | **Interactive Messages** | Native Baileys interactive messages, native flow buttons, list/select menus, and carousel structures | ✅ |
96
102
  | **Flow Buttons** | `quick_reply`, `cta_url`, `cta_copy` and more button types | ✅ |
97
103
  | **Native Button** | Native WhatsApp button structures | ✅ |
98
- | **Carousel** | Multi-card carousel messages via Dugong | ✅ |
99
- | **AI Rich Response** | `sendTable`, `sendList`, `sendCodeBlock`, `sendRichMessage`, `sendUnifiedResponse` | ✅ |
104
+ | **Carousel** | Multi-card carousel messages using Baileys `interactiveMessage` / `carouselMessage` structures | ✅ |
105
+ | **AI Rich Response** | Rich-response message structures plus Kyyinfinite helper methods such as `sendTable`, `sendList`, `sendCodeBlock`, and `sendUnifiedResponse` | ✅ |
100
106
  | **Album Messages** | Multi-image/video album relay with count metadata and grouped delivery | ✅ |
101
107
  | **Link Messages** | Rich inline links with citations, proofs, and forwarded bot context | ✅ |
102
108
  | **Table Message** | `sendTable()` / `sendTableV2()` styled as Meta AI tables | ✅ |
@@ -124,6 +130,7 @@ with native support for **interactive messages**, **album messages**, **unified
124
130
  | Requirement | Version / Detail |
125
131
  |---|---|
126
132
  | **Node.js** | `>= 20.0.0` |
133
+ | **Baileys base** | `7.0.0-rc14` |
127
134
  | **Module system** | ESM only — `"type": "module"` in `package.json` |
128
135
  | **Auth store** | Persistent auth required for production use |
129
136
 
@@ -364,6 +371,320 @@ sock.ev.on("connection.update", ({ connection, lastDisconnect }) => {
364
371
 
365
372
  ---
366
373
 
374
+ ## ✨ Simple API
375
+
376
+ > [!NOTE]
377
+ > **v2.0.0** introduces the `@kyyinfinite/baileys` Simple API — a fluent wrapper on top of the native socket.
378
+ > Native Baileys methods remain available and unchanged.
379
+
380
+ ### Setup
381
+
382
+ ```js
383
+ import makeWASocket, {
384
+ useMultiFileAuthState,
385
+ attachKyyinfinite,
386
+ } from "@kyyinfinite/baileys";
387
+
388
+ const { state, saveCreds } = await useMultiFileAuthState("./session");
389
+
390
+ const sock = makeWASocket({
391
+ auth: state,
392
+ });
393
+
394
+ sock.ev.on("creds.update", saveCreds);
395
+
396
+ attachKyyinfinite(sock);
397
+ ```
398
+
399
+ After attaching the wrapper, the socket can use both the original Baileys API and the simpler fluent API.
400
+
401
+ ### Text
402
+
403
+ ```js
404
+ await sock.text("Hello")
405
+ .send(jid);
406
+ ```
407
+
408
+ ### Media
409
+
410
+ ```js
411
+ await sock.image({ url: "./image.jpg" })
412
+ .caption("Hello")
413
+ .send(jid);
414
+
415
+ await sock.video({ url: "./video.mp4" })
416
+ .caption("Video")
417
+ .send(jid);
418
+
419
+ await sock.audio({ url: "./audio.mp3" })
420
+ .send(jid);
421
+
422
+ await sock.voice({ url: "./voice.ogg" })
423
+ .send(jid);
424
+
425
+ await sock.sticker({ url: "./sticker.webp" })
426
+ .send(jid);
427
+
428
+ await sock.document({ url: "./file.pdf" })
429
+ .fileName("document.pdf")
430
+ .send(jid);
431
+
432
+ await sock.ptv({ url: "./video.mp4" })
433
+ .send(jid);
434
+
435
+ await sock.gif({ url: "./video.mp4" })
436
+ .send(jid);
437
+ ```
438
+
439
+ ### Message Builder
440
+
441
+ ```js
442
+ await sock.text("Hello")
443
+ .footer("Powered by @kyyinfinite/baileys")
444
+ .mentions(["6281234567890@s.whatsapp.net"])
445
+ .send(jid);
446
+ ```
447
+
448
+ Supported fluent options include:
449
+
450
+ ```text
451
+ text()
452
+ footer()
453
+ context()
454
+ mentions()
455
+ viewOnce()
456
+ edit()
457
+ payload()
458
+ build()
459
+ send()
460
+ ```
461
+
462
+ ### Buttons
463
+
464
+ ```js
465
+ await sock.button()
466
+ .title("Welcome")
467
+ .body("Choose an option")
468
+ .footer("Powered by @kyyinfinite/baileys")
469
+ .addButton("Menu", "menu")
470
+ .send(jid);
471
+ ```
472
+
473
+ CTA helpers are also available:
474
+
475
+ ```js
476
+ await sock.button()
477
+ .title("Actions")
478
+ .body("Choose an action")
479
+ .reply("Reply", "reply_1")
480
+ .url("Website", "https://example.com")
481
+ .copy("Copy", "KYY-001")
482
+ .call("Call", "628123456789")
483
+ .send(jid);
484
+ ```
485
+
486
+ The copy helper also supports the shorthand typo-compatible alias:
487
+
488
+ ```js
489
+ .copy("Copy", "KYY-001")
490
+ .coppy("Copy", "KYY-001")
491
+ ```
492
+
493
+ Additional button helpers:
494
+
495
+ ```text
496
+ reply() / quickReply()
497
+ call()
498
+ url()
499
+ copy() / coppy()
500
+ reminder()
501
+ cancelReminder()
502
+ address()
503
+ location()
504
+ select()
505
+ section()
506
+ row()
507
+ ```
508
+
509
+ ### ButtonV2
510
+
511
+ ```js
512
+ await sock.buttonV2()
513
+ .title("Button V2")
514
+ .body("Choose an option")
515
+ .send(jid);
516
+ ```
517
+
518
+ The raw builder is still available when full low-level control is required.
519
+
520
+ ### Carousel
521
+
522
+ The carousel API supports a nested fluent card builder:
523
+
524
+ ```js
525
+ await sock.carousel()
526
+ .body("Choose a product")
527
+ .footer("Kyyinfinite")
528
+ .card()
529
+ .image({ url: "./product-1.jpg" })
530
+ .title("Product One")
531
+ .body("Product description")
532
+ .button("Pilih", "product_1")
533
+ .url("Website", "https://example.com")
534
+ .copy("Copy Code", "KYY-001")
535
+ .call("Call", "628123456789")
536
+ .add()
537
+ .card()
538
+ .image({ url: "./product-2.jpg" })
539
+ .title("Product Two")
540
+ .body("Product two")
541
+ .button("Pilih", "product_2")
542
+ .add()
543
+ .send(jid);
544
+ ```
545
+
546
+ Card helpers:
547
+
548
+ ```text
549
+ title()
550
+ body() / text()
551
+ footer()
552
+ image()
553
+ video()
554
+ media()
555
+ button()
556
+ reply() / quickReply()
557
+ url()
558
+ copy() / coppy()
559
+ call()
560
+ buttons()
561
+ rawButton()
562
+ context()
563
+ payload()
564
+ build()
565
+ add()
566
+ end()
567
+ ```
568
+
569
+ Carousel helpers:
570
+
571
+ ```text
572
+ card()
573
+ addCard()
574
+ cards()
575
+ clear()
576
+ title()
577
+ subtitle()
578
+ body() / text()
579
+ footer()
580
+ context()
581
+ payload()
582
+ loadFrom()
583
+ build()
584
+ send()
585
+ ```
586
+
587
+ ### Generic Message Helpers
588
+
589
+ ```js
590
+ await sock.message({ text: "Hello" })
591
+ .send(jid);
592
+
593
+ await sock.poll(
594
+ "What's your favorite language?",
595
+ ["JavaScript", "TypeScript", "Python"],
596
+ 1
597
+ ).send(jid);
598
+
599
+ await sock.location({
600
+ degreesLatitude: -6.2088,
601
+ degreesLongitude: 106.8456,
602
+ name: "Jakarta"
603
+ }).send(jid);
604
+
605
+ await sock.react(msg.key, "👍");
606
+
607
+ await sock.delete(msg.key);
608
+ ```
609
+
610
+ Available helpers include:
611
+
612
+ ```text
613
+ message()
614
+ poll()
615
+ event()
616
+ album()
617
+ contacts()
618
+ location()
619
+ buttonReply()
620
+ listReply()
621
+ react()
622
+ groupInvite()
623
+ product()
624
+ requestPhoneNumber()
625
+ sharePhoneNumber()
626
+ pin()
627
+ forward()
628
+ delete()
629
+ disappearing()
630
+ limitSharing()
631
+ ```
632
+
633
+ ### Non-mutating API
634
+
635
+ If you do not want to modify the socket object, create a separate API facade:
636
+
637
+ ```js
638
+ import {
639
+ createKyyinfinite,
640
+ } from "@kyyinfinite/baileys";
641
+
642
+ const api = createKyyinfinite(sock);
643
+
644
+ await api.text("Hello")
645
+ .send(jid);
646
+ ```
647
+
648
+ The facade keeps the original socket accessible through `api.raw`:
649
+
650
+ ```js
651
+ api.raw
652
+ ```
653
+
654
+ Raw wrapper classes are available through:
655
+
656
+ ```js
657
+ api.raw.Button
658
+ api.raw.ButtonV2
659
+ api.raw.Carousel
660
+ api.raw.AIRich
661
+ api.raw.Toolkit
662
+ api.raw.Foad
663
+ api.raw.Foad2
664
+ ```
665
+
666
+ Use the Simple API for everyday message construction while keeping the raw builders available whenever lower-level control is needed.
667
+
668
+ ### Native Baileys Still Works
669
+
670
+ The Simple API does not replace native socket methods:
671
+
672
+ ```js
673
+ await sock.sendMessage(jid, {
674
+ text: "Hello from native Baileys"
675
+ });
676
+
677
+ await sock.sendPresenceUpdate("composing", jid);
678
+
679
+ sock.ev.on("messages.upsert", ({ messages }) => {
680
+ console.log(messages);
681
+ });
682
+ ```
683
+
684
+ Use the Simple API when you want shorter, cleaner code. Use the native API or `.raw` builders whenever you need lower-level control.
685
+
686
+ ---
687
+
367
688
  ## 💬 Message Examples
368
689
 
369
690
  ### Text
@@ -551,8 +872,8 @@ await sock.sendMessage(jid, {
551
872
  ## ⚡ Interactive Messages
552
873
 
553
874
  > [!NOTE]
554
- > Interactive messages are powered by the **Dugong** layer in `@kyyinfinite/baileys`.
555
- > These are not available in the official WhiskeySockets/Baileys.
875
+ > Interactive messages are based on the native **Baileys v7.0.0-rc14** message structures.
876
+ > The Kyyinfinite Simple API provides a shorter fluent interface on top of those native structures.
556
877
 
557
878
  ### Flow Buttons
558
879
 
@@ -657,43 +978,74 @@ await sock.sendMessage(jid, {
657
978
 
658
979
  ### Carousel
659
980
 
981
+ For the native Baileys structure, a carousel is represented by an `interactiveMessage` containing a `carouselMessage`. Media headers are prepared before the message is relayed:
982
+
660
983
  ```js
661
- import { Dugong } from "@kyyinfinite/baileys";
984
+ import {
985
+ proto,
986
+ prepareWAMessageMedia,
987
+ generateWAMessageFromContent,
988
+ } from "@kyyinfinite/baileys";
662
989
 
663
- await sock.sendMessage(jid, {
664
- interactiveMessage: Dugong.carousel({
665
- cards: [
666
- {
667
- header: {
668
- imageUrl: "https://example.com/card1.jpg",
669
- },
670
- title: "Card One",
671
- body: "Description for the first card.",
672
- buttons: [
673
- {
674
- name: "quick_reply",
675
- buttonParamsJson: JSON.stringify({ display_text: "Select", id: "card_1" }),
676
- },
677
- ],
990
+ const cards = [];
991
+
992
+ for (const [index, imageUrl] of [
993
+ "https://example.com/card1.jpg",
994
+ "https://example.com/card2.jpg",
995
+ ]) {
996
+ const media = await prepareWAMessageMedia(
997
+ { image: { url: imageUrl } },
998
+ { upload: sock.waUploadToServer },
999
+ );
1000
+
1001
+ cards.push(
1002
+ proto.Message.InteractiveMessage.fromObject({
1003
+ header: {
1004
+ title: `Card ${index + 1}`,
1005
+ hasMediaAttachment: true,
1006
+ ...media,
678
1007
  },
679
- {
680
- header: {
681
- imageUrl: "https://example.com/card2.jpg",
682
- },
683
- title: "Card Two",
684
- body: "Description for the second card.",
1008
+ body: { text: `Description for card ${index + 1}` },
1009
+ footer: { text: "@kyyinfinite/baileys" },
1010
+ nativeFlowMessage: {
685
1011
  buttons: [
686
1012
  {
687
1013
  name: "quick_reply",
688
- buttonParamsJson: JSON.stringify({ display_text: "Select", id: "card_2" }),
1014
+ buttonParamsJson: JSON.stringify({
1015
+ display_text: "Select",
1016
+ id: `card_${index + 1}`,
1017
+ }),
689
1018
  },
690
1019
  ],
691
1020
  },
692
- ],
693
- }),
694
- });
1021
+ }),
1022
+ );
1023
+ }
1024
+
1025
+ const message = generateWAMessageFromContent(
1026
+ jid,
1027
+ {
1028
+ viewOnceMessage: {
1029
+ message: {
1030
+ interactiveMessage: proto.Message.InteractiveMessage.fromObject({
1031
+ body: { text: "Choose a product" },
1032
+ footer: { text: "Swipe to see more" },
1033
+ carouselMessage: { cards },
1034
+ }),
1035
+ },
1036
+ },
1037
+ },
1038
+ {},
1039
+ );
1040
+
1041
+ await sock.relayMessage(
1042
+ jid,
1043
+ message.message,
1044
+ { messageId: message.key.id },
1045
+ );
695
1046
  ```
696
1047
 
1048
+
697
1049
  ### Native Interactive
698
1050
 
699
1051
  Combine multiple button types in a single message:
@@ -735,7 +1087,7 @@ await sock.sendMessage(jid, {
735
1087
 
736
1088
  > [!NOTE]
737
1089
  > These message types are styled to match **Meta AI's** WhatsApp response format — tables, code blocks, and rich linked text.
738
- > They are exclusive to `@kyyinfinite/baileys` and not available in official Baileys.
1090
+ > The underlying rich-response message types are part of the Baileys v7 line. The `sendTable()`, `sendList()`, `sendCodeBlock()`, and related convenience methods documented here are exposed by this package.
739
1091
 
740
1092
  ### sendTable()
741
1093
 
@@ -767,7 +1119,7 @@ await sock.sendList(
767
1119
  "Bot Information",
768
1120
  [
769
1121
  ["Package", "@kyyinfinite/baileys"],
770
- ["Version", "0.1.0"],
1122
+ ["Version", "2.0.0"],
771
1123
  ["Developer", "kyyinfinite"],
772
1124
  ["License", "MIT"],
773
1125
  ["Node", ">= 20"],
@@ -1286,8 +1638,6 @@ import {
1286
1638
  DisconnectReason,
1287
1639
  Browsers,
1288
1640
 
1289
- //advance
1290
- Dugong,
1291
1641
 
1292
1642
  } from "@kyyinfinite/baileys";
1293
1643
  ```
@@ -1465,30 +1815,24 @@ Then instantiate a separate `makeWASocket` for each session.
1465
1815
  <details>
1466
1816
  <summary><strong>Interactive messages are not rendering. What's wrong?</strong></summary>
1467
1817
 
1468
- Interactive messages (flow buttons, carousels, list menus) require:
1469
-
1470
- - A **WhatsApp Business API**-capable number, or
1471
- - A number that has been granted access to the interactive message API by WhatsApp.
1472
-
1473
- On regular personal numbers, interactive messages may silently fail or show as plain text.
1818
+ Interactive messages depend on the message type, current WhatsApp client behavior, and server-side availability. Rendering can differ between WhatsApp Web, Android, and iOS. Test the specific interactive structure with the account and client versions you target.
1474
1819
 
1475
1820
  </details>
1476
1821
 
1477
1822
  <details>
1478
1823
  <summary><strong>What is the difference from official Baileys?</strong></summary>
1479
1824
 
1480
- | Area | Official Baileys | @kyyinfinite/baileys |
1825
+ | Area | Baileys v7.0.0-rc14 | @kyyinfinite/baileys |
1481
1826
  |---|---|---|
1482
- | Interactive messages | No native support | ✅ Full support via Dugong |
1483
- | Album messages | Not supported | ✅ Multi-media albums |
1484
- | AI Rich Response | Not available | ✅ Table, code block, rich text |
1485
- | Table V2 | Not available | ✅ Unified response |
1486
- | Code Block V2 | Not available | ✅ 6 languages |
1487
- | Link Message | Not available | ✅ Inline embeds + citations |
1488
- | Newsletter extras | Basic only | ✅ Bulk follow, URL resolve, admin |
1489
- | Payment messages | Not supported | ✅ Full support |
1490
- | Status mentions | Not available | ✅ `sendStatusMention()` |
1491
- | LID support | Basic | ✅ Full LID↔PN mapping + migration |
1827
+ | Native socket API | | ✅ Preserved |
1828
+ | ESM | | ✅ |
1829
+ | Interactive messages | Native structures | ✅ Plus fluent builders |
1830
+ | Carousel messages | Native `carouselMessage` structures | ✅ Plus nested carousel builder |
1831
+ | Rich responses | Native rich-response structures | ✅ Plus convenience helpers |
1832
+ | Media messages | | ✅ Plus fluent media builders |
1833
+ | Newsletter / Group / Business APIs | ✅ | Native API preserved |
1834
+ | Simple fluent API | | ✅ `text()`, `image()`, `button()`, `carousel()`, etc. |
1835
+ | Raw escape hatch | Native socket / proto APIs | ✅ `api.raw` + native socket |
1492
1836
 
1493
1837
  </details>
1494
1838
 
@@ -1543,7 +1887,7 @@ copies or substantial portions of the Software.
1543
1887
 
1544
1888
  <br/>
1545
1889
 
1546
- **© 2026 kyyinfinite — `@kyyinfinite/baileys` v0.1.0 • MIT License**
1890
+ **© 2026 kyyinfinite — `@kyyinfinite/baileys` v2.0.0 • MIT License**
1547
1891
 
1548
1892
  *Built on top of [WhiskeySockets/Baileys](https://github.com/WhiskeySockets/Baileys)*
1549
1893