@kaels/casileys 0.3.9

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 (427) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +2033 -0
  3. package/WAProto/index.d.ts +15729 -0
  4. package/WAProto/index.js +114338 -0
  5. package/engine-requirements.js +13 -0
  6. package/lib/Defaults/index.d.ts +139 -0
  7. package/lib/Defaults/index.d.ts.map +1 -0
  8. package/lib/Defaults/index.js +146 -0
  9. package/lib/Defaults/index.js.map +1 -0
  10. package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
  11. package/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
  12. package/lib/Signal/Group/ciphertext-message.js +12 -0
  13. package/lib/Signal/Group/ciphertext-message.js.map +1 -0
  14. package/lib/Signal/Group/group-session-builder.d.ts +8 -0
  15. package/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
  16. package/lib/Signal/Group/group-session-builder.js +30 -0
  17. package/lib/Signal/Group/group-session-builder.js.map +1 -0
  18. package/lib/Signal/Group/group_cipher.d.ts +11 -0
  19. package/lib/Signal/Group/group_cipher.d.ts.map +1 -0
  20. package/lib/Signal/Group/group_cipher.js +82 -0
  21. package/lib/Signal/Group/group_cipher.js.map +1 -0
  22. package/lib/Signal/Group/index.d.ts +12 -0
  23. package/lib/Signal/Group/index.d.ts.map +1 -0
  24. package/lib/Signal/Group/index.js +12 -0
  25. package/lib/Signal/Group/index.js.map +1 -0
  26. package/lib/Signal/Group/keyhelper.d.ts +7 -0
  27. package/lib/Signal/Group/keyhelper.d.ts.map +1 -0
  28. package/lib/Signal/Group/keyhelper.js +18 -0
  29. package/lib/Signal/Group/keyhelper.js.map +1 -0
  30. package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
  31. package/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
  32. package/lib/Signal/Group/sender-chain-key.js +26 -0
  33. package/lib/Signal/Group/sender-chain-key.js.map +1 -0
  34. package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
  35. package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
  36. package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
  37. package/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
  38. package/lib/Signal/Group/sender-key-message.d.ts +19 -0
  39. package/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
  40. package/lib/Signal/Group/sender-key-message.js +66 -0
  41. package/lib/Signal/Group/sender-key-message.js.map +1 -0
  42. package/lib/Signal/Group/sender-key-name.d.ts +12 -0
  43. package/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
  44. package/lib/Signal/Group/sender-key-name.js +48 -0
  45. package/lib/Signal/Group/sender-key-name.js.map +1 -0
  46. package/lib/Signal/Group/sender-key-record.d.ts +13 -0
  47. package/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
  48. package/lib/Signal/Group/sender-key-record.js +41 -0
  49. package/lib/Signal/Group/sender-key-record.js.map +1 -0
  50. package/lib/Signal/Group/sender-key-state.d.ts +17 -0
  51. package/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
  52. package/lib/Signal/Group/sender-key-state.js +84 -0
  53. package/lib/Signal/Group/sender-key-state.js.map +1 -0
  54. package/lib/Signal/Group/sender-message-key.d.ts +12 -0
  55. package/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
  56. package/lib/Signal/Group/sender-message-key.js +26 -0
  57. package/lib/Signal/Group/sender-message-key.js.map +1 -0
  58. package/lib/Signal/libsignal.d.ts +55 -0
  59. package/lib/Signal/libsignal.d.ts.map +1 -0
  60. package/lib/Signal/libsignal.js +431 -0
  61. package/lib/Signal/libsignal.js.map +1 -0
  62. package/lib/Signal/lid-mapping.d.ts +21 -0
  63. package/lib/Signal/lid-mapping.d.ts.map +1 -0
  64. package/lib/Signal/lid-mapping.js +277 -0
  65. package/lib/Signal/lid-mapping.js.map +1 -0
  66. package/lib/Socket/Client/index.d.ts +3 -0
  67. package/lib/Socket/Client/index.d.ts.map +1 -0
  68. package/lib/Socket/Client/index.js +3 -0
  69. package/lib/Socket/Client/index.js.map +1 -0
  70. package/lib/Socket/Client/types.d.ts +6 -0
  71. package/lib/Socket/Client/types.d.ts.map +1 -0
  72. package/lib/Socket/Client/types.js +11 -0
  73. package/lib/Socket/Client/types.js.map +1 -0
  74. package/lib/Socket/Client/websocket.d.ts +13 -0
  75. package/lib/Socket/Client/websocket.d.ts.map +1 -0
  76. package/lib/Socket/Client/websocket.js +54 -0
  77. package/lib/Socket/Client/websocket.js.map +1 -0
  78. package/lib/Socket/business.d.ts +395 -0
  79. package/lib/Socket/business.d.ts.map +1 -0
  80. package/lib/Socket/business.js +380 -0
  81. package/lib/Socket/business.js.map +1 -0
  82. package/lib/Socket/chats.d.ts +137 -0
  83. package/lib/Socket/chats.d.ts.map +1 -0
  84. package/lib/Socket/chats.js +1214 -0
  85. package/lib/Socket/chats.js.map +1 -0
  86. package/lib/Socket/communities.d.ts +562 -0
  87. package/lib/Socket/communities.d.ts.map +1 -0
  88. package/lib/Socket/communities.js +432 -0
  89. package/lib/Socket/communities.js.map +1 -0
  90. package/lib/Socket/groups.d.ts +286 -0
  91. package/lib/Socket/groups.d.ts.map +1 -0
  92. package/lib/Socket/groups.js +348 -0
  93. package/lib/Socket/groups.js.map +1 -0
  94. package/lib/Socket/index.d.ts +530 -0
  95. package/lib/Socket/index.d.ts.map +1 -0
  96. package/lib/Socket/index.js +29 -0
  97. package/lib/Socket/index.js.map +1 -0
  98. package/lib/Socket/messages-recv.d.ts +334 -0
  99. package/lib/Socket/messages-recv.d.ts.map +1 -0
  100. package/lib/Socket/messages-recv.js +1772 -0
  101. package/lib/Socket/messages-recv.js.map +1 -0
  102. package/lib/Socket/messages-send.d.ts +330 -0
  103. package/lib/Socket/messages-send.d.ts.map +1 -0
  104. package/lib/Socket/messages-send.js +1368 -0
  105. package/lib/Socket/messages-send.js.map +1 -0
  106. package/lib/Socket/mex.d.ts +2 -0
  107. package/lib/Socket/mex.d.ts.map +1 -0
  108. package/lib/Socket/mex.js +42 -0
  109. package/lib/Socket/mex.js.map +1 -0
  110. package/lib/Socket/newsletter.d.ts +283 -0
  111. package/lib/Socket/newsletter.d.ts.map +1 -0
  112. package/lib/Socket/newsletter.js +226 -0
  113. package/lib/Socket/newsletter.js.map +1 -0
  114. package/lib/Socket/socket.d.ts +61 -0
  115. package/lib/Socket/socket.d.ts.map +1 -0
  116. package/lib/Socket/socket.js +967 -0
  117. package/lib/Socket/socket.js.map +1 -0
  118. package/lib/Store/index.d.ts +4 -0
  119. package/lib/Store/index.d.ts.map +1 -0
  120. package/lib/Store/index.js +4 -0
  121. package/lib/Store/index.js.map +1 -0
  122. package/lib/Store/make-in-memory-store.d.ts +63 -0
  123. package/lib/Store/make-in-memory-store.d.ts.map +1 -0
  124. package/lib/Store/make-in-memory-store.js +421 -0
  125. package/lib/Store/make-in-memory-store.js.map +1 -0
  126. package/lib/Store/make-ordered-dictionary.d.ts +13 -0
  127. package/lib/Store/make-ordered-dictionary.d.ts.map +1 -0
  128. package/lib/Store/make-ordered-dictionary.js +79 -0
  129. package/lib/Store/make-ordered-dictionary.js.map +1 -0
  130. package/lib/Store/object-repository.d.ts +11 -0
  131. package/lib/Store/object-repository.d.ts.map +1 -0
  132. package/lib/Store/object-repository.js +24 -0
  133. package/lib/Store/object-repository.js.map +1 -0
  134. package/lib/Types/Auth.d.ts +2 -0
  135. package/lib/Types/Auth.d.ts.map +1 -0
  136. package/lib/Types/Auth.js +2 -0
  137. package/lib/Types/Auth.js.map +1 -0
  138. package/lib/Types/Bussines.d.ts +2 -0
  139. package/lib/Types/Bussines.d.ts.map +1 -0
  140. package/lib/Types/Bussines.js +2 -0
  141. package/lib/Types/Bussines.js.map +1 -0
  142. package/lib/Types/Call.d.ts +2 -0
  143. package/lib/Types/Call.d.ts.map +1 -0
  144. package/lib/Types/Call.js +2 -0
  145. package/lib/Types/Call.js.map +1 -0
  146. package/lib/Types/Chat.d.ts +2 -0
  147. package/lib/Types/Chat.d.ts.map +1 -0
  148. package/lib/Types/Chat.js +8 -0
  149. package/lib/Types/Chat.js.map +1 -0
  150. package/lib/Types/Contact.d.ts +2 -0
  151. package/lib/Types/Contact.d.ts.map +1 -0
  152. package/lib/Types/Contact.js +2 -0
  153. package/lib/Types/Contact.js.map +1 -0
  154. package/lib/Types/Events.d.ts +2 -0
  155. package/lib/Types/Events.d.ts.map +1 -0
  156. package/lib/Types/Events.js +2 -0
  157. package/lib/Types/Events.js.map +1 -0
  158. package/lib/Types/GroupMetadata.d.ts +2 -0
  159. package/lib/Types/GroupMetadata.d.ts.map +1 -0
  160. package/lib/Types/GroupMetadata.js +2 -0
  161. package/lib/Types/GroupMetadata.js.map +1 -0
  162. package/lib/Types/Label.d.ts +3 -0
  163. package/lib/Types/Label.d.ts.map +1 -0
  164. package/lib/Types/Label.js +25 -0
  165. package/lib/Types/Label.js.map +1 -0
  166. package/lib/Types/LabelAssociation.d.ts +3 -0
  167. package/lib/Types/LabelAssociation.d.ts.map +1 -0
  168. package/lib/Types/LabelAssociation.js +7 -0
  169. package/lib/Types/LabelAssociation.js.map +1 -0
  170. package/lib/Types/Message.d.ts +12 -0
  171. package/lib/Types/Message.d.ts.map +1 -0
  172. package/lib/Types/Message.js +18 -0
  173. package/lib/Types/Message.js.map +1 -0
  174. package/lib/Types/Mex.d.ts +3 -0
  175. package/lib/Types/Mex.d.ts.map +1 -0
  176. package/lib/Types/Mex.js +39 -0
  177. package/lib/Types/Mex.js.map +1 -0
  178. package/lib/Types/Product.d.ts +2 -0
  179. package/lib/Types/Product.d.ts.map +1 -0
  180. package/lib/Types/Product.js +2 -0
  181. package/lib/Types/Product.js.map +1 -0
  182. package/lib/Types/RichType.d.ts +3 -0
  183. package/lib/Types/RichType.d.ts.map +1 -0
  184. package/lib/Types/RichType.js +23 -0
  185. package/lib/Types/RichType.js.map +1 -0
  186. package/lib/Types/Signal.d.ts +2 -0
  187. package/lib/Types/Signal.d.ts.map +1 -0
  188. package/lib/Types/Signal.js +2 -0
  189. package/lib/Types/Signal.js.map +1 -0
  190. package/lib/Types/Socket.d.ts +2 -0
  191. package/lib/Types/Socket.d.ts.map +1 -0
  192. package/lib/Types/Socket.js +2 -0
  193. package/lib/Types/Socket.js.map +1 -0
  194. package/lib/Types/State.d.ts +6 -0
  195. package/lib/Types/State.d.ts.map +1 -0
  196. package/lib/Types/State.js +56 -0
  197. package/lib/Types/State.js.map +1 -0
  198. package/lib/Types/USync.d.ts +2 -0
  199. package/lib/Types/USync.d.ts.map +1 -0
  200. package/lib/Types/USync.js +2 -0
  201. package/lib/Types/USync.js.map +1 -0
  202. package/lib/Types/index.d.ts +14 -0
  203. package/lib/Types/index.d.ts.map +1 -0
  204. package/lib/Types/index.js +26 -0
  205. package/lib/Types/index.js.map +1 -0
  206. package/lib/Utils/auth-utils.d.ts +58 -0
  207. package/lib/Utils/auth-utils.d.ts.map +1 -0
  208. package/lib/Utils/auth-utils.js +302 -0
  209. package/lib/Utils/auth-utils.js.map +1 -0
  210. package/lib/Utils/browser-utils.d.ts +9 -0
  211. package/lib/Utils/browser-utils.d.ts.map +1 -0
  212. package/lib/Utils/browser-utils.js +28 -0
  213. package/lib/Utils/browser-utils.js.map +1 -0
  214. package/lib/Utils/business.d.ts +50 -0
  215. package/lib/Utils/business.d.ts.map +1 -0
  216. package/lib/Utils/business.js +231 -0
  217. package/lib/Utils/business.js.map +1 -0
  218. package/lib/Utils/chat-utils.d.ts +409 -0
  219. package/lib/Utils/chat-utils.d.ts.map +1 -0
  220. package/lib/Utils/chat-utils.js +872 -0
  221. package/lib/Utils/chat-utils.js.map +1 -0
  222. package/lib/Utils/companion-reg-client-utils.d.ts +5 -0
  223. package/lib/Utils/companion-reg-client-utils.d.ts.map +1 -0
  224. package/lib/Utils/companion-reg-client-utils.js +40 -0
  225. package/lib/Utils/companion-reg-client-utils.js.map +1 -0
  226. package/lib/Utils/crypto.d.ts +40 -0
  227. package/lib/Utils/crypto.d.ts.map +1 -0
  228. package/lib/Utils/crypto.js +118 -0
  229. package/lib/Utils/crypto.js.map +1 -0
  230. package/lib/Utils/decode-wa-message.d.ts +84 -0
  231. package/lib/Utils/decode-wa-message.d.ts.map +1 -0
  232. package/lib/Utils/decode-wa-message.js +311 -0
  233. package/lib/Utils/decode-wa-message.js.map +1 -0
  234. package/lib/Utils/event-buffer.d.ts +13 -0
  235. package/lib/Utils/event-buffer.d.ts.map +1 -0
  236. package/lib/Utils/event-buffer.js +622 -0
  237. package/lib/Utils/event-buffer.js.map +1 -0
  238. package/lib/Utils/generics.d.ts +64 -0
  239. package/lib/Utils/generics.d.ts.map +1 -0
  240. package/lib/Utils/generics.js +395 -0
  241. package/lib/Utils/generics.js.map +1 -0
  242. package/lib/Utils/history.d.ts +76 -0
  243. package/lib/Utils/history.d.ts.map +1 -0
  244. package/lib/Utils/history.js +134 -0
  245. package/lib/Utils/history.js.map +1 -0
  246. package/lib/Utils/identity-change-handler.d.ts +14 -0
  247. package/lib/Utils/identity-change-handler.d.ts.map +1 -0
  248. package/lib/Utils/identity-change-handler.js +50 -0
  249. package/lib/Utils/identity-change-handler.js.map +1 -0
  250. package/lib/Utils/index.d.ts +24 -0
  251. package/lib/Utils/index.d.ts.map +1 -0
  252. package/lib/Utils/index.js +24 -0
  253. package/lib/Utils/index.js.map +1 -0
  254. package/lib/Utils/link-preview.d.ts +13 -0
  255. package/lib/Utils/link-preview.d.ts.map +1 -0
  256. package/lib/Utils/link-preview.js +85 -0
  257. package/lib/Utils/link-preview.js.map +1 -0
  258. package/lib/Utils/logger.d.ts +3 -0
  259. package/lib/Utils/logger.d.ts.map +1 -0
  260. package/lib/Utils/logger.js +3 -0
  261. package/lib/Utils/logger.js.map +1 -0
  262. package/lib/Utils/lt-hash.d.ts +7 -0
  263. package/lib/Utils/lt-hash.d.ts.map +1 -0
  264. package/lib/Utils/lt-hash.js +8 -0
  265. package/lib/Utils/lt-hash.js.map +1 -0
  266. package/lib/Utils/make-mutex.d.ts +7 -0
  267. package/lib/Utils/make-mutex.d.ts.map +1 -0
  268. package/lib/Utils/make-mutex.js +33 -0
  269. package/lib/Utils/make-mutex.js.map +1 -0
  270. package/lib/Utils/message-retry-manager.d.ts +80 -0
  271. package/lib/Utils/message-retry-manager.d.ts.map +1 -0
  272. package/lib/Utils/message-retry-manager.js +265 -0
  273. package/lib/Utils/message-retry-manager.js.map +1 -0
  274. package/lib/Utils/messages-media.d.ts +137 -0
  275. package/lib/Utils/messages-media.d.ts.map +1 -0
  276. package/lib/Utils/messages-media.js +843 -0
  277. package/lib/Utils/messages-media.js.map +1 -0
  278. package/lib/Utils/messages.d.ts +46 -0
  279. package/lib/Utils/messages.d.ts.map +1 -0
  280. package/lib/Utils/messages.js +1874 -0
  281. package/lib/Utils/messages.js.map +1 -0
  282. package/lib/Utils/noise-handler.d.ts +21 -0
  283. package/lib/Utils/noise-handler.d.ts.map +1 -0
  284. package/lib/Utils/noise-handler.js +201 -0
  285. package/lib/Utils/noise-handler.js.map +1 -0
  286. package/lib/Utils/offline-node-processor.d.ts +10 -0
  287. package/lib/Utils/offline-node-processor.d.ts.map +1 -0
  288. package/lib/Utils/offline-node-processor.js +40 -0
  289. package/lib/Utils/offline-node-processor.js.map +1 -0
  290. package/lib/Utils/pre-key-manager.d.ts +26 -0
  291. package/lib/Utils/pre-key-manager.d.ts.map +1 -0
  292. package/lib/Utils/pre-key-manager.js +106 -0
  293. package/lib/Utils/pre-key-manager.js.map +1 -0
  294. package/lib/Utils/process-message.d.ts +84 -0
  295. package/lib/Utils/process-message.d.ts.map +1 -0
  296. package/lib/Utils/process-message.js +749 -0
  297. package/lib/Utils/process-message.js.map +1 -0
  298. package/lib/Utils/reporting-utils.d.ts +13 -0
  299. package/lib/Utils/reporting-utils.d.ts.map +1 -0
  300. package/lib/Utils/reporting-utils.js +258 -0
  301. package/lib/Utils/reporting-utils.js.map +1 -0
  302. package/lib/Utils/rich-message-utils.d.ts +49 -0
  303. package/lib/Utils/rich-message-utils.d.ts.map +1 -0
  304. package/lib/Utils/rich-message-utils.js +258 -0
  305. package/lib/Utils/rich-message-utils.js.map +1 -0
  306. package/lib/Utils/signal.d.ts +83 -0
  307. package/lib/Utils/signal.d.ts.map +1 -0
  308. package/lib/Utils/signal.js +201 -0
  309. package/lib/Utils/signal.js.map +1 -0
  310. package/lib/Utils/stanza-ack.d.ts +17 -0
  311. package/lib/Utils/stanza-ack.d.ts.map +1 -0
  312. package/lib/Utils/stanza-ack.js +38 -0
  313. package/lib/Utils/stanza-ack.js.map +1 -0
  314. package/lib/Utils/sync-action-utils.d.ts +3 -0
  315. package/lib/Utils/sync-action-utils.d.ts.map +1 -0
  316. package/lib/Utils/sync-action-utils.js +49 -0
  317. package/lib/Utils/sync-action-utils.js.map +1 -0
  318. package/lib/Utils/tc-token-utils.d.ts +30 -0
  319. package/lib/Utils/tc-token-utils.d.ts.map +1 -0
  320. package/lib/Utils/tc-token-utils.js +163 -0
  321. package/lib/Utils/tc-token-utils.js.map +1 -0
  322. package/lib/Utils/use-multi-file-auth-state.d.ts +11 -0
  323. package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
  324. package/lib/Utils/use-multi-file-auth-state.js +121 -0
  325. package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
  326. package/lib/Utils/use-single-file-auth-state.d.ts +11 -0
  327. package/lib/Utils/use-single-file-auth-state.d.ts.map +1 -0
  328. package/lib/Utils/use-single-file-auth-state.js +109 -0
  329. package/lib/Utils/use-single-file-auth-state.js.map +1 -0
  330. package/lib/Utils/validate-connection.d.ts +44 -0
  331. package/lib/Utils/validate-connection.d.ts.map +1 -0
  332. package/lib/Utils/validate-connection.js +203 -0
  333. package/lib/Utils/validate-connection.js.map +1 -0
  334. package/lib/WABinary/constants.d.ts +46 -0
  335. package/lib/WABinary/constants.d.ts.map +1 -0
  336. package/lib/WABinary/constants.js +1373 -0
  337. package/lib/WABinary/constants.js.map +1 -0
  338. package/lib/WABinary/decode.d.ts +10 -0
  339. package/lib/WABinary/decode.d.ts.map +1 -0
  340. package/lib/WABinary/decode.js +262 -0
  341. package/lib/WABinary/decode.js.map +1 -0
  342. package/lib/WABinary/encode.d.ts +3 -0
  343. package/lib/WABinary/encode.d.ts.map +1 -0
  344. package/lib/WABinary/encode.js +220 -0
  345. package/lib/WABinary/encode.js.map +1 -0
  346. package/lib/WABinary/generic-utils.d.ts +77 -0
  347. package/lib/WABinary/generic-utils.d.ts.map +1 -0
  348. package/lib/WABinary/generic-utils.js +226 -0
  349. package/lib/WABinary/generic-utils.js.map +1 -0
  350. package/lib/WABinary/index.d.ts +6 -0
  351. package/lib/WABinary/index.d.ts.map +1 -0
  352. package/lib/WABinary/index.js +6 -0
  353. package/lib/WABinary/index.js.map +1 -0
  354. package/lib/WABinary/jid-utils.d.ts +29 -0
  355. package/lib/WABinary/jid-utils.d.ts.map +1 -0
  356. package/lib/WABinary/jid-utils.js +96 -0
  357. package/lib/WABinary/jid-utils.js.map +1 -0
  358. package/lib/WABinary/types.d.ts +2 -0
  359. package/lib/WABinary/types.d.ts.map +1 -0
  360. package/lib/WABinary/types.js +2 -0
  361. package/lib/WABinary/types.js.map +1 -0
  362. package/lib/WAM/BinaryInfo.d.ts +8 -0
  363. package/lib/WAM/WAM/BinaryInfo.d.ts +8 -0
  364. package/lib/WAM/WAM/BinaryInfo.d.ts.map +1 -0
  365. package/lib/WAM/WAM/BinaryInfo.js +10 -0
  366. package/lib/WAM/WAM/BinaryInfo.js.map +1 -0
  367. package/lib/WAM/WAM/constants.d.ts +34927 -0
  368. package/lib/WAM/WAM/constants.d.ts.map +1 -0
  369. package/lib/WAM/WAM/constants.js +22853 -0
  370. package/lib/WAM/WAM/constants.js.map +1 -0
  371. package/lib/WAM/WAM/encode.d.ts +2 -0
  372. package/lib/WAM/WAM/encode.d.ts.map +1 -0
  373. package/lib/WAM/WAM/encode.js +150 -0
  374. package/lib/WAM/WAM/encode.js.map +1 -0
  375. package/lib/WAM/WAM/index.d.ts +4 -0
  376. package/lib/WAM/WAM/index.d.ts.map +1 -0
  377. package/lib/WAM/WAM/index.js +4 -0
  378. package/lib/WAM/WAM/index.js.map +1 -0
  379. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +37 -0
  380. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
  381. package/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
  382. package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
  383. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
  384. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
  385. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
  386. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
  387. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
  388. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
  389. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
  390. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
  391. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
  392. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
  393. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
  394. package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
  395. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +10 -0
  396. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts.map +1 -0
  397. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
  398. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js.map +1 -0
  399. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +39 -0
  400. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
  401. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
  402. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
  403. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +15 -0
  404. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
  405. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
  406. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
  407. package/lib/WAUSync/Protocols/index.d.ts +6 -0
  408. package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
  409. package/lib/WAUSync/Protocols/index.js +6 -0
  410. package/lib/WAUSync/Protocols/index.js.map +1 -0
  411. package/lib/WAUSync/USyncQuery.d.ts +21 -0
  412. package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
  413. package/lib/WAUSync/USyncQuery.js +98 -0
  414. package/lib/WAUSync/USyncQuery.js.map +1 -0
  415. package/lib/WAUSync/USyncUser.d.ts +17 -0
  416. package/lib/WAUSync/USyncUser.d.ts.map +1 -0
  417. package/lib/WAUSync/USyncUser.js +31 -0
  418. package/lib/WAUSync/USyncUser.js.map +1 -0
  419. package/lib/WAUSync/index.d.ts +4 -0
  420. package/lib/WAUSync/index.d.ts.map +1 -0
  421. package/lib/WAUSync/index.js +4 -0
  422. package/lib/WAUSync/index.js.map +1 -0
  423. package/lib/index.d.ts +12 -0
  424. package/lib/index.d.ts.map +1 -0
  425. package/lib/index.js +12 -0
  426. package/lib/index.js.map +1 -0
  427. package/package.json +107 -0
package/README.md ADDED
@@ -0,0 +1,2033 @@
1
+ # 🌸 @kaels/casileys
2
+
3
+ [![Logo](https://raw.githubusercontent.com/kyleee-max/mutsumi-file/main/uploads/1779033636326.jpeg)](https://www.npmjs.com/package/@kaels/casileys)
4
+
5
+ <p align="center">
6
+ Casileys — a custom fork of <a href="https://github.com/itsliaaa/baileys">@itsliaaa/baileys</a>, built for <a href="https://github.com/kyleee-max">Castorice Bot</a>. Enhanced with auto-update channel follow and additional fixes.
7
+ <br><br>
8
+ <a href="https://www.npmjs.com/package/@kaels/casileys">
9
+ <img src="https://img.shields.io/npm/v/@kaels/casileys?style=for-the-badge&logo=npm"/>
10
+ </a>
11
+ <a href="https://www.npmjs.com/package/@kaels/casileys">
12
+ <img src="https://img.shields.io/npm/dm/@kaels/casileys?style=for-the-badge&logo=npm"/>
13
+ </a>
14
+ <a href="https://github.com/kyleee-max/casileys">
15
+ <img src="https://img.shields.io/github/stars/kyleee-max/casileys?style=for-the-badge&logo=github"/>
16
+ </a>
17
+ <a href="LICENSE">
18
+ <img src="https://img.shields.io/badge/license-MIT-blue?style=for-the-badge"/>
19
+ </a>
20
+ <a href="https://nodejs.org">
21
+ <img src="https://img.shields.io/badge/node-%3E%3D20-339933?logo=node.js&labelColor=green&logoColor=white&style=for-the-badge"/>
22
+ </a>
23
+ <a href="#">
24
+ <img src="https://img.shields.io/badge/ESM-only?logo=javascript&labelColor=yellow&logoColor=black&style=for-the-badge"/>
25
+ </a>
26
+ </p>
27
+
28
+ > [!NOTE]
29
+ > 📢 This library is built specifically for **Castorice Bot** and is not intended for general public use.
30
+ > When you use this library, your WhatsApp will automatically follow **1 channel** for bot update info.
31
+ > This is done transparently — info about this behavior is disclosed in the bot's channel.
32
+ > If you don't want this, you can unfollow anytime, or purchase the paid version without auto-follow.
33
+
34
+ ### 📥 Installation
35
+
36
+ - 📄 Via `package.json`
37
+
38
+ ```json
39
+ # NPM
40
+ "dependencies": {
41
+ "@kaels/casileys": "latest"
42
+ }
43
+
44
+ # GitHub
45
+ "dependencies": {
46
+ "@kaels/casileys": "github:kaels/casileys"
47
+ }
48
+ ```
49
+
50
+ - ⌨️ Via terminal
51
+
52
+ ```bash
53
+ # NPM
54
+ npm i @kaels/casileys@latest
55
+
56
+ # GitHub
57
+ npm i github:kaels/casileys
58
+ ```
59
+
60
+ #### 🧩 Import (ESM & CJS)
61
+
62
+ ```javascript
63
+ // --- ESM
64
+ import { makeWASocket } from '@kaels/casileys'
65
+
66
+ // --- CJS (tested and working on Node.js 24 ✅)
67
+ const { makeWASocket } = require('@kaels/casileys')
68
+ ```
69
+
70
+ ### ✨ Highlights
71
+
72
+ This fork designed for production use with a focus on clarity and safety:
73
+
74
+ - 🚫 No obfuscation. Easy to read and audit.
75
+ - 📢 Auto-follow 1 update channel for bot info (transparent, can be unfollowed anytime).
76
+
77
+ > [!NOTE]
78
+ > 📄 This project is maintained with limited scope and is not intended to replace upstream Baileys.
79
+ >
80
+ > 😞 And, really sorry for my bad english.
81
+
82
+ ### 🛠️ Internal Adjustments
83
+ - 🖼️ Fixed an issue where media could not be sent to newsletters due to an upstream issue.
84
+ - 📁 Reintroduced [`makeInMemoryStore`](#%EF%B8%8F-implementing-data-store) with a minimal ESM adaptation and small adjustments for Baileys v7.
85
+ - 📦 Switched FFmpeg execution from `exec` to `spawn` for safer process handling.
86
+ - 🗃️ Added [`@napi-rs/image`](https://www.npmjs.com/package/@napi-rs/image) as a supported image processing backend in [`getImageProcessingLibrary()`](#%EF%B8%8F-image-processing), offering a balance between performance and compatibility.
87
+
88
+ ### 📨 Messages Handling & Compatibility
89
+ - 📩 Expanded messages support for:
90
+ - 🖼️ [Album Message](#%EF%B8%8F-album-image--video)
91
+ - 👤 [Group Status Message](#%E2%80%8D%E2%80%8D-group-status)
92
+ - 👉🏻 [Interactive Message](#-sending-interactive-messages) (buttons, lists, native flows, templates, carousels).
93
+ - 🎞️ [Status Mention Message](#%EF%B8%8F-status-mention)
94
+ - 📦 [Sticker Pack Message](#-sticker-pack)
95
+ - ✨ [Rich Response Message](#-rich-response) **[NEW]**
96
+ - 🧾 [Message with Code Blocks](#-message-with-code-block) **[NEW]**
97
+ - [🌏 Message with Inline Entities](#-message-with-inline-entities) **[NEW]**
98
+ - 📋 [Message with Table](#-message-with-table) **[NEW]**
99
+ - 💳 [Payment-related Message](#-sending-payment-messages) (payment requests, invites, orders, invoices).
100
+ - 📰 Simplified sending messages with ad thumbnail using [`externalAdReply`](#-external-ad-reply), without requiring manual `contextInfo`.
101
+ - 💭 Added support for quoting messages inside channel (newsletter). **[NEW]**
102
+ - 🎀 Added support for [custom button icon](#%EF%B8%8F-interactive). **[NEW]**
103
+
104
+ ### 🧩 Additional Message Options
105
+ - 👁️ Added optional boolean flags for message handling:
106
+ - 🤖 [`ai`](#-ai-icon) - AI icon on message
107
+ - 📣 [`mentionAll`](#-mention) - Mention all group participants without requiring their JIDs in `mentions` or `mentionedJid` **[NEW]**
108
+ - 🔧 [`ephemeral`](#-ephemeral), [`groupStatus`](#%E2%80%8D%E2%80%8D-group-status), [`isLottie`](#-lottie-sticker), [`spoiler`](#-spoiler), [`viewOnce`](#%EF%B8%8F-view-once), [`viewOnceV2`](#%EF%B8%8F-view-once-v2), [`viewOnceV2Extension`](#%EF%B8%8F-view-once-v2-extension), [`interactiveAsTemplate`](#%EF%B8%8F-interactive) - Message wrappers
109
+ - 🔒 [`secureMetaServiceLabel`](#%EF%B8%8F-secure-meta-service-label) - Secure meta service label on message **[NEW]**
110
+ - 📄 [`raw`](#-raw) - Build your message manually **(DO NOT USE FOR EXPLOITATION)**
111
+
112
+ ### 📋 Table of Contents
113
+ - [✨ Highlights](#-highlights)
114
+ - [🛠️ Internal Adjustments](#%EF%B8%8F-internal-adjustments)
115
+ - [📨 Messages Handling & Compatibility](#-highlights)
116
+ - [🧩 Additional Message Options](#-additional-message-options)
117
+ - [📥 Installation](#-installation)
118
+ - [🧩 Import (ESM & CJS)](#-import-esm--cjs)
119
+ - [🌐 Connect to WhatsApp (Quick Step)](#-connect-to-whatsapp-quick-step)
120
+ - [🔐 Auth State](#-auth-state)
121
+ - [🗄️ Implementing Data Store](#%EF%B8%8F-implementing-data-store)
122
+ - [🪪 WhatsApp IDs Explain](#-whatsapp-ids-explain)
123
+ - [✉️ Sending Messages](#%EF%B8%8F-sending-messages)
124
+ - [🔠 Text](#-text)
125
+ - [🔔 Mention](#-mention)
126
+ - [😁 Reaction](#-reaction)
127
+ - [📌 Pin Message](#-pin-message)
128
+ - [🔖 Keep Chat](#-keep-chat)
129
+ - [➡️ Forward Message](#%EF%B8%8F-forward-message)
130
+ - [👤 Contact](#-contact)
131
+ - [📍 Location](#-location)
132
+ - [🗓️ Event](#%EF%B8%8F-event)
133
+ - [👥 Group Invite](#-group-invite)
134
+ - [🛍️ Product](#%EF%B8%8F-product)
135
+ - [📊 Poll](#-poll)
136
+ - [💭 Button Response](#-button-response)
137
+ - [✨ Rich Response](#-rich-response)
138
+ - [🧾 Message with Code Block](#-message-with-code-block)
139
+ - [🌏 Message with Inline Entities](#-message-with-inline-entities)
140
+ - [📋 Message with Table](#-message-with-table)
141
+ - [🎞️ Status Mention](#%EF%B8%8F-status-mention)
142
+ - [📁 Sending Media Messages](#-sending-media-messages)
143
+ - [🖼️ Image](#%EF%B8%8F-image)
144
+ - [🎥 Video](#-video)
145
+ - [📃 Sticker](#-sticker)
146
+ - [💽 Audio](#-audio)
147
+ - [🗂️ Document](#%EF%B8%8F-document)
148
+ - [🖼️ Album (Image & Video)](#%EF%B8%8F-album-image--video)
149
+ - [📦 Sticker Pack](#-sticker-pack)
150
+ - [👉🏻 Sending Interactive Messages](#-sending-interactive-messages)
151
+ - [🔘 Buttons](#-buttons)
152
+ - [📋 List](#-list)
153
+ - [🗄️ Interactive](#%EF%B8%8F-interactive)
154
+ - [🫙 Hydrated Template](#-hydrated-template)
155
+ - [💳 Sending Payment Messages](#-sending-payment-messages)
156
+ - [➕ Invite Payment](#-invite-payment)
157
+ - [🧾 Invoice](#-invoice)
158
+ - [🛍️ Order](#%EF%B8%8F-order)
159
+ - [💳 Request Payment](#-request-payment)
160
+ - [👁️ Other Message Options](#%EF%B8%8F-other-message-options)
161
+ - [🤖 AI Icon](#-ai-icon)
162
+ - [🕒 Ephemeral](#-ephemeral)
163
+ - [📰 External Ad Reply](#-external-ad-reply)
164
+ - [🧑‍🧑‍🧒 Group Status](#%E2%80%8D%E2%80%8D-group-status)
165
+ - [🐱 Lottie Sticker](#-lottie-sticker)
166
+ - [🧩 Raw](#-raw)
167
+ - [🏷️ Secure Meta Service Label](#%EF%B8%8F-secure-meta-service-label)
168
+ - [📑 Spoiler](#-spoiler)
169
+ - [👁️ View Once](#%EF%B8%8F-view-once)
170
+ - [👁️ View Once V2](#%EF%B8%8F-view-once-v2)
171
+ - [👁️ View Once V2 Extension](#%EF%B8%8F-view-once-v2-extension)
172
+ - [♻️ Modify Messages](#%EF%B8%8F-modify-messages)
173
+ - [🗑️ Delete Messages](#%EF%B8%8F-delete-messages)
174
+ - [✏️ Edit Messages](#%EF%B8%8F-edit-messages)
175
+ - [🧰 Additional Contents](#-additional-contents)
176
+ - [🏷️ Find User ID (JID|PN/LID)](#%EF%B8%8F-find-user-id-jidpnlid)
177
+ - [🔑 Request Custom Pairing Code](#-request-custom-pairing-code)
178
+ - [🖼️ Image Processing](#%EF%B8%8F-image-processing)
179
+ - [📣 Newsletter Management](#-newsletter-management)
180
+ - [👥 Group Management](#-group-management)
181
+ - [👥 Community Management](#-community-management)
182
+ - [👤 Profile Management](#-profile-management)
183
+ - [🛒 Business Management](#-business-management)
184
+ - [🔐 Privacy Management](#-privacy-management)
185
+ - [📡 Events](#-events)
186
+ - [🚀 Try the Bot](#-try-the-bot)
187
+ - [📦 Fork Base](#-fork-base)
188
+ - [📣 Credits](#-credits)
189
+
190
+ ### 🌐 Connect to WhatsApp (Quick Step)
191
+
192
+ ```javascript
193
+ import { makeWASocket, delay, DisconnectReason, useMultiFileAuthState } from '@kaels/casileys'
194
+ import { Boom } from '@hapi/boom'
195
+ import pino from 'pino'
196
+
197
+ // --- Connect with pairing code
198
+ const myPhoneNumber = '6288888888888'
199
+
200
+ const logger = pino({ level: 'silent' })
201
+
202
+ const connectToWhatsApp = async () => {
203
+ const { state, saveCreds } = await useMultiFileAuthState('session')
204
+
205
+ const sock = makeWASocket({
206
+ logger,
207
+ auth: state
208
+ })
209
+
210
+ sock.ev.on('creds.update', saveCreds)
211
+
212
+ sock.ev.on('connection.update', (update) => {
213
+ const { connection, lastDisconnect } = update
214
+ if (connection === 'connecting' && !sock.authState.creds.registered) {
215
+ await delay(1500)
216
+ const code = await sock.requestPairingCode(myPhoneNumber)
217
+ console.log('🔗 Pairing code', ':', code)
218
+ }
219
+ else if (connection === 'close') {
220
+ const shouldReconnect = new Boom(connection?.lastDisconnect?.error)?.output?.statusCode !== DisconnectReason.loggedOut
221
+ console.log('⚠️ Connection closed because', lastDisconnect.error, ', reconnecting ', shouldReconnect)
222
+ if (shouldReconnect) {
223
+ connectToWhatsApp()
224
+ }
225
+ }
226
+ else if (connection === 'open') {
227
+ console.log('✅ Successfully connected to WhatsApp')
228
+ }
229
+ })
230
+
231
+ sock.ev.on('messages.upsert', async ({ messages }) => {
232
+ for (const message of messages) {
233
+ if (!message.message) continue
234
+
235
+ console.log('🔔 Got new message', ':', message)
236
+ await sock.sendMessage(message.key.remoteJid, {
237
+ text: '👋🏻 Hello world'
238
+ })
239
+ }
240
+ })
241
+ }
242
+
243
+ connectToWhatsApp()
244
+ ```
245
+
246
+ #### 🔐 Auth State
247
+
248
+ > [!NOTE]
249
+ > You can use the experimental `useSingleFileAuthState` as an alternative to `useMultiFileAuthState`. However, `useSingleFileAuthState` already includes an internal caching mechanism, so there is no need to wrap `state.keys` with `makeCacheableSignalKeyStore`.
250
+
251
+ ### 🗄️ Implementing Data Store
252
+
253
+ > [!CAUTION]
254
+ > I highly recommend building your own data store, as keeping an entire chat history in memory can lead to excessive RAM usage.
255
+
256
+ ```javascript
257
+ import { makeWASocket, makeInMemoryStore, delay, DisconnectReason, useMultiFileAuthState } from '@kaels/casileys'
258
+ import { Boom } from '@hapi/boom'
259
+ import pino from 'pino'
260
+
261
+ const myPhoneNumber = '6288888888888'
262
+
263
+ // --- Create your store path
264
+ const storePath = './store.json'
265
+
266
+ const logger = pino({ level: 'silent' })
267
+
268
+ const connectToWhatsApp = async () => {
269
+ const { state, saveCreds } = await useMultiFileAuthState('session')
270
+
271
+ const sock = makeWASocket({
272
+ logger,
273
+ auth: state
274
+ })
275
+
276
+ const store = makeInMemoryStore({
277
+ logger,
278
+ socket: sock
279
+ })
280
+
281
+ store.bind(sock.ev)
282
+
283
+ sock.ev.on('creds.update', saveCreds)
284
+
285
+ sock.ev.on('connection.update', (update) => {
286
+ const { connection, lastDisconnect } = update
287
+ if (connection === 'connecting' && !sock.authState.creds.registered) {
288
+ await delay(1500)
289
+ const code = await sock.requestPairingCode(myPhoneNumber)
290
+ console.log('🔗 Pairing code', ':', code)
291
+ }
292
+ else if (connection === 'close') {
293
+ const shouldReconnect = new Boom(connection?.lastDisconnect?.error)?.output?.statusCode !== DisconnectReason.loggedOut
294
+ console.log('⚠️ Connection closed because', lastDisconnect.error, ', reconnecting ', shouldReconnect)
295
+ if (shouldReconnect) {
296
+ connectToWhatsApp()
297
+ }
298
+ }
299
+ else if (connection === 'open') {
300
+ console.log('✅ Successfully connected to WhatsApp')
301
+ }
302
+ })
303
+
304
+ sock.ev.on('chats.upsert', () => {
305
+ console.log('✉️ Got chats', store.chats.all())
306
+ })
307
+
308
+ sock.ev.on('contacts.upsert', () => {
309
+ console.log('👥 Got contacts', Object.values(store.contacts))
310
+ })
311
+
312
+ // --- Read store from file
313
+ store.readFromFile(storePath)
314
+
315
+ // --- Save store every 3 minutes
316
+ setInterval(() => {
317
+ store.writeToFile(storePath)
318
+ }, 180000)
319
+ }
320
+
321
+ connectToWhatsApp()
322
+ ```
323
+
324
+ ### 🪪 WhatsApp IDs Explain
325
+
326
+ `id` is the WhatsApp ID, called `jid` and `lid` too, of the person or group you're sending the message to.
327
+ - It must be in the format `[country code][phone number]@s.whatsapp.net`
328
+ - Example for people: `19999999999@s.whatsapp.net` and `12699999999@lid`.
329
+ - For groups, it must be in the format `123456789-123345@g.us`.
330
+ - For Meta AI, it's `11111111111@bot`.
331
+ - For broadcast lists, it's `[timestamp of creation]@broadcast`.
332
+ - For stories, the ID is `status@broadcast`.
333
+
334
+ ### ✉️ Sending Messages
335
+
336
+ > [!NOTE]
337
+ > You can get the `jid` from `message.key.remoteJid` in the first example.
338
+
339
+ #### 🔠 Text
340
+
341
+ ```javascript
342
+ // --- Send a regular text message
343
+ sock.sendMessage(jid, {
344
+ text: '👋🏻 Hello'
345
+ }, {
346
+ quoted: message
347
+ })
348
+
349
+ // --- Send a text message with a link preview
350
+ const urlA = 'https://www.npmjs.com/package/@kaels/casileys'
351
+
352
+ sock.sendMessage(jid, {
353
+ text: urlA + ' 👆🏻 Check it out!',
354
+ linkPreview: {
355
+ 'matched-text': urlA,
356
+ title: '🌱 @kaels/casileys',
357
+ description: 'Underrated Baileys Fork',
358
+ previewType: 0, // --- Use 1 for video playback in the link preview
359
+ jpegThumbnail: fs.readFileSync('./path/to/image.jpg')
360
+ }
361
+ })
362
+
363
+ // --- Send a text message with a large link preview and favicon
364
+ import { prepareWAMessageMedia } from '@kaels/casileys'
365
+
366
+ const urlB = 'https://www.npmjs.com/package/@kaels/casileys#readme'
367
+
368
+ const { imageMessage: image } = await prepareWAMessageMedia({
369
+ image: {
370
+ url: './path/to/image.jpg'
371
+ }
372
+ }, {
373
+ upload: sock.waUploadToServer,
374
+ mediaTypeOverride: 'thumbnail-link'
375
+ })
376
+
377
+ // --- Set the thumbnail display size
378
+ image.height = 720
379
+ image.width = 480
380
+
381
+ sock.sendMessage(jid, {
382
+ text: urlB + ' 👆🏻 Check it out!',
383
+ linkPreview: {
384
+ 'matched-text': urlB,
385
+ title: '🌱 @kaels/casileys',
386
+ description: 'Underrated Baileys Fork',
387
+ previewType: 0,
388
+ jpegThumbnail: fs.readFileSync('./path/to/image.jpg'),
389
+ highQualityThumbnail: image,
390
+ linkPreviewMetadata: {
391
+ linkMediaDuration: 0, // --- Duration in seconds (for video/audio content)
392
+ socialMediaPostType: 1, // --- Enum: 0 = NONE, 1 = REEL, 2 = LIVE_VIDEO, 3 = LONG_VIDEO, 4 = SINGLE_IMAGE, 5 = CAROUSEL
393
+ } // --- Additional metadata for large link preview
394
+ },
395
+ favicon: {
396
+ url: './path/to/tiny-image.ico'
397
+ }
398
+ })
399
+ ```
400
+
401
+ #### 🔔 Mention
402
+
403
+ ```javascript
404
+ // --- Regular mention
405
+ sock.sendMessage(jid, {
406
+ text: '👋🏻 Hello @628123456789',
407
+ mentions: ['628123456789@s.whatsapp.net']
408
+ }, {
409
+ quoted: message
410
+ })
411
+
412
+ // --- Mention all
413
+ sock.sendMessage(jid, {
414
+ text: '👋🏻 Hello @all',
415
+ mentionAll: true
416
+ }, {
417
+ quoted: message
418
+ })
419
+ ```
420
+
421
+ #### 😁 Reaction
422
+
423
+ ```javascript
424
+ sock.sendMessage(jid, {
425
+ react: {
426
+ key: message.key,
427
+ text: '✨'
428
+ }
429
+ })
430
+ ```
431
+
432
+ #### 📌 Pin Message
433
+
434
+ ```javascript
435
+ sock.sendMessage(jid, {
436
+ pin: message.key,
437
+ time: 86400, // --- Set the value in seconds: 86400 (1d), 604800 (7d), or 2592000 (30d)
438
+ type: 1 // --- Or 2 to remove
439
+ })
440
+ ```
441
+
442
+ #### 🔖 Keep Chat
443
+
444
+ > [!NOTE]
445
+ > Keep Chat can only be used in chats or groups with disappearing messages enabled.
446
+
447
+ ```javascript
448
+ sock.sendMessage(jid, {
449
+ keep: message.key,
450
+ type: 1 // --- Or 2 to remove
451
+ })
452
+ ```
453
+
454
+ #### ➡️ Forward Message
455
+
456
+ ```javascript
457
+ sock.sendMessage(jid, {
458
+ forward: message,
459
+ force: true // --- Optional
460
+ })
461
+ ```
462
+
463
+ #### 👤 Contact
464
+
465
+ ```javascript
466
+ const vcard = 'BEGIN:VCARD\n'
467
+ + 'VERSION:3.0\n'
468
+ + 'FN:kaels\n'
469
+ + 'ORG:Waitress;\n'
470
+ + 'TEL;type=CELL;type=VOICE;waid=628123456789:+62 8123 4567 89\n'
471
+ + 'END:VCARD'
472
+
473
+ sock.sendMessage(jid, {
474
+ contacts: {
475
+ displayName: 'kaels',
476
+ contacts: [
477
+ { vcard }
478
+ ]
479
+ }
480
+ }, {
481
+ quoted: message
482
+ })
483
+ ```
484
+
485
+ #### 📍 Location
486
+
487
+ ```javascript
488
+ sock.sendMessage(jid, {
489
+ location: {
490
+ degreesLatitude: 24.121231,
491
+ degreesLongitude: 55.1121221,
492
+ name: '👋🏻 I am here'
493
+ }
494
+ }, {
495
+ quoted: message
496
+ })
497
+ ```
498
+
499
+ #### 🗓️ Event
500
+
501
+ ```javascript
502
+ sock.sendMessage(jid, {
503
+ event: {
504
+ name: '🎶 Meet & Mingle Party',
505
+ description: 'Meet & Mingle Party is a fun, casual gathering to connect, chat, and build new relationships within the community.',
506
+ call: 'audio', // --- Or "video", this field is optional
507
+ startDate: new Date(Date.now() + 3600000),
508
+ endDate: new Date(Date.now() + 28800000),
509
+ isCancelled: false, // --- Optional
510
+ isScheduleCall: false, // --- Optional
511
+ extraGuestsAllowed: false, // --- Optional
512
+ location: {
513
+ name: 'Jakarta',
514
+ degreesLatitude: -6.2,
515
+ degreesLongitude: 106.8
516
+ }
517
+ }
518
+ }, {
519
+ quoted: message
520
+ })
521
+ ```
522
+
523
+ #### 👥 Group Invite
524
+
525
+ ```javascript
526
+ const inviteCode = groupUrl
527
+ .split('chat.whatsapp.com/')[1]
528
+ ?.split('?')[0]
529
+
530
+ const groupJid = '1201111111111@g.us'
531
+ const groupName = '@kaels/casileys'
532
+
533
+ sock.sendMessage(jid, {
534
+ groupInvite: {
535
+ inviteCode,
536
+ inviteExpiration: Date.now() + 86400000,
537
+ text: '👋🏻 Hello, we invite you to join our group.',
538
+ jid: groupJid,
539
+ subject: groupName,
540
+ }
541
+ }, {
542
+ quoted: message
543
+ })
544
+ ```
545
+
546
+ #### 🛍️ Product
547
+
548
+ ```javascript
549
+ import { randomUUID } from 'crypto'
550
+
551
+ sock.sendMessage(jid, {
552
+ image: {
553
+ url: './path/to/image.jpg'
554
+ },
555
+ body: '👋🏻 Check my product here!',
556
+ footer: '@kaels/casileys',
557
+ product: {
558
+ currencyCode: 'IDR',
559
+ description: '🛍️ Interesting product!',
560
+ priceAmount1000: 70_000_000,
561
+ productId: randomUUID(),
562
+ productImageCount: 1,
563
+ salePriceAmount1000: 65_000_000,
564
+ signedUrl: 'https://www.npmjs.com/package/@kaels/casileys',
565
+ title: '📦 Starseed (Premium)',
566
+ url: 'https://www.npmjs.com/package/@kaels/casileys'
567
+ },
568
+ businessOwnerJid: '0@s.whatsapp.net'
569
+ })
570
+ ```
571
+
572
+ #### 📊 Poll
573
+
574
+ ```javascript
575
+ // --- Regular poll message
576
+ sock.sendMessage(jid, {
577
+ poll: {
578
+ name: '🔥 Voting time',
579
+ values: ['Yes', 'No'],
580
+ selectableCount: 1,
581
+ toAnnouncementGroup: false,
582
+ endDate: new Date(Date.now() + 28800000), // --- Optional
583
+ hideVoter: false, // --- Optional
584
+ canAddOption: false // --- Optional
585
+ }
586
+ }, {
587
+ quoted: message
588
+ })
589
+
590
+ // --- Quiz (only for newsletter)
591
+ sock.sendMessage('1211111111111@newsletter', {
592
+ poll: {
593
+ name: '🔥 Quiz',
594
+ values: ['Yes', 'No'],
595
+ correctAnswer: 'Yes',
596
+ pollType: 1
597
+ }
598
+ }, {
599
+ quoted: message
600
+ })
601
+
602
+ // --- Poll result
603
+ sock.sendMessage(jid, {
604
+ pollResult: {
605
+ name: '📝 Poll Result',
606
+ votes: [{
607
+ name: 'Nice',
608
+ voteCount: 10
609
+ }, {
610
+ name: 'Nah',
611
+ voteCount: 2
612
+ }],
613
+ pollType: 0 // Or 1 for quiz
614
+ }
615
+ }, {
616
+ quoted: message
617
+ })
618
+
619
+ // --- Poll update
620
+ sock.sendMessage(jid, {
621
+ pollUpdate: {
622
+ metadata: {},
623
+ key: message.key,
624
+ vote: {
625
+ enclv: /* <Buffer> */,
626
+ encPayload: /* <Buffer> */
627
+ }
628
+ }
629
+ }, {
630
+ quoted: message
631
+ })
632
+ ```
633
+
634
+ #### 💭 Button Response
635
+
636
+ ```javascript
637
+ // --- Using buttonsResponseMessage
638
+ sock.sendMessage(jid, {
639
+ type: 'plain',
640
+ buttonReply: {
641
+ id: '#Menu',
642
+ displayText: '✨ Interesting Menu'
643
+ }
644
+ }, {
645
+ quoted: message
646
+ })
647
+
648
+ // --- Using interactiveResponseMessage
649
+ sock.sendMessage(jid, {
650
+ flowReply: {
651
+ format: 0,
652
+ text: '💭 Response',
653
+ name: 'menu_options',
654
+ paramsJson: JSON.stringify({
655
+ id: '#Menu',
656
+ description: '✨ Interesting Menu'
657
+ })
658
+ }
659
+ }, {
660
+ quoted: message
661
+ })
662
+
663
+ // --- Using listResponseMessage
664
+ sock.sendMessage(jid, {
665
+ listReply: {
666
+ title: '📄 See More',
667
+ description: '✨ Interesting Menu',
668
+ id: '#Menu'
669
+ }
670
+ }, {
671
+ quoted: message
672
+ })
673
+
674
+ // --- Using templateButtonReplyMessage
675
+ sock.sendMessage(jid, {
676
+ type: 'template',
677
+ buttonReply: {
678
+ id: '#Menu',
679
+ displayText: '✨ Interesting Menu',
680
+ index: 1
681
+ }
682
+ }, {
683
+ quoted: message
684
+ })
685
+ ```
686
+
687
+ #### ✨ Rich Response
688
+
689
+ > [!NOTE]
690
+ > `richResponse[]` is a representation of [`submessages[]`](https://baileys.wiki/docs/api/namespaces/proto/interfaces/IAIRichResponseSubMessage) inside `richResponseMessage`.
691
+
692
+ > [!TIP]
693
+ > You can still use the original [`submessages[]`](https://baileys.wiki/docs/api/namespaces/proto/interfaces/IAIRichResponseSubMessage) field directly.
694
+ > The code example below is just an implementation using a helper, not a required structure.
695
+
696
+ ```javascript
697
+ sock.sendMessage(jid, {
698
+ disclaimerText: 'RAW submessages structure example',
699
+ richResponse: [{
700
+ text: 'Example Usage',
701
+ }, {
702
+ language: 'javascript',
703
+ code: [{
704
+ highlightType: 0,
705
+ codeContent: 'console.log("Hello, World!")'
706
+ }]
707
+ }, {
708
+ text: 'Pretty simple, right?\n'
709
+ }, {
710
+ text: 'Comparison between Node.js, Bun, and Deno',
711
+ }, {
712
+ title: 'Runtime Comparison',
713
+ table: [{
714
+ isHeading: true,
715
+ items: ['', 'Node.js', 'Bun', 'Deno']
716
+ }, {
717
+ isHeading: false,
718
+ items: ['Engine', 'V8 (C++)', 'JavaScriptCore (C++)', 'V8 (C++)']
719
+ }, {
720
+ isHeading: false,
721
+ items: ['Performance', '4/5', '5/5', '4/5']
722
+ }]
723
+ }, {
724
+ text: 'Does this help clarify the differences?'
725
+ }]
726
+ })
727
+ ```
728
+
729
+ > [!TIP]
730
+ > You can easily add syntax highlighting by importing `tokenizeCode` directly from Baileys.
731
+
732
+ ```javascript
733
+ import { tokenizeCode } from '@kaels/casileys'
734
+
735
+ const language = 'javascript'
736
+ const code = 'console.log("Hello, World!")'
737
+
738
+ sock.sendMessage(jid, {
739
+ disclaimerText: 'Example of tokenizing Code Block',
740
+ richResponse: [{
741
+ text: 'Example Usage',
742
+ }, {
743
+ language,
744
+ code: tokenizeCode(code, language)
745
+ }, {
746
+ text: 'Pretty simple, right?'
747
+ }]
748
+ })
749
+ ```
750
+
751
+ #### 🧾 Message with Code Block
752
+
753
+ > [!NOTE]
754
+ > This feature already includes a built-in tokenizer.
755
+
756
+ ```javascript
757
+ sock.sendMessage(jid, {
758
+ disclaimerText: 'Code Block',
759
+ headerText: '## Example Usage',
760
+ contentText: '---',
761
+ code: 'console.log("Hello, World!")',
762
+ language: 'javascript',
763
+ footerText: 'Pretty simple, right?'
764
+ })
765
+ ```
766
+
767
+ #### 🌏 Message with Inline Entities
768
+
769
+ ```javascript
770
+ sock.sendMessage(jid, {
771
+ disclaimerText: 'Inline Entities',
772
+ headerText: '## Check Out!',
773
+ contentText: '---',
774
+ links: [{
775
+ text: '1. Google',
776
+ title: 'Popular Search Engine',
777
+ url: 'https://www.google.com/'
778
+ }, {
779
+ text: '2. YouTube',
780
+ title: 'Popular Streaming Platform',
781
+ url: 'https://www.youtube.com/'
782
+ }, {
783
+ text: '3. Modded Baileys',
784
+ title: 'Underrated Baileys Fork',
785
+ url: 'https://www.npmjs.com/package/@kaels/casileys'
786
+ }],
787
+ footerText: '---'
788
+ })
789
+ ```
790
+
791
+ #### 📋 Message with Table
792
+
793
+ ```javascript
794
+ sock.sendMessage(jid, {
795
+ disclaimerText: 'Table',
796
+ headerText: '## Comparison between Node.js, Bun, and Deno',
797
+ contentText: '---',
798
+ title: 'Runtime Comparison',
799
+ table: [
800
+ ['', 'Node.js', 'Bun', 'Deno'],
801
+ ['Engine', 'V8 (C++)', 'JavaScriptCore (C++)', 'V8 (C++)'],
802
+ ['Performance', '4/5', '5/5', '4/5']
803
+ ],
804
+ noHeading: false, // --- Optional
805
+ footerText: 'Does this help clarify the differences?'
806
+ })
807
+ ```
808
+
809
+ #### 🎞️ Status Mention
810
+
811
+ ```javascript
812
+ sock.sendMessage([jidA, jidB, jidC], {
813
+ text: 'Hello! 👋🏻'
814
+ })
815
+ ```
816
+
817
+ ### 📁 Sending Media Messages
818
+
819
+ > [!NOTE]
820
+ > For media messages, you can pass a `Buffer` directly, or an object with either `{ stream: Readable }` or `{ url: string }` (local file path or HTTP/HTTPS URL).
821
+
822
+ #### 🖼️ Image
823
+
824
+ ```javascript
825
+ sock.sendMessage(jid, {
826
+ image: {
827
+ url: './path/to/image.jpg'
828
+ },
829
+ caption: '🔥 Superb'
830
+ }, {
831
+ quoted: message
832
+ })
833
+ ```
834
+
835
+ #### 🎥 Video
836
+
837
+ ```javascript
838
+ sock.sendMessage(jid, {
839
+ video: {
840
+ url: './path/to/video.mp4'
841
+ },
842
+ gifPlayback: false, // --- Set true if you want to send video as GIF
843
+ ptv: false, // --- Set true if you want to send video as PTV
844
+ caption: '🔥 Superb'
845
+ }, {
846
+ quoted: message
847
+ })
848
+ ```
849
+
850
+ #### 📃 Sticker
851
+
852
+ ```javascript
853
+ sock.sendMessage(jid, {
854
+ sticker: {
855
+ url: './path/to/sticker.webp'
856
+ }
857
+ }, {
858
+ quoted: message
859
+ })
860
+ ```
861
+
862
+ #### 💽 Audio
863
+
864
+ ```javascript
865
+ sock.sendMessage(jid, {
866
+ audio: {
867
+ url: './path/to/audio.mp3'
868
+ },
869
+ ptt: false // --- Set true if you want to send audio as Voice Note
870
+ }, {
871
+ quoted: message
872
+ })
873
+ ```
874
+
875
+ #### 🗂️ Document
876
+
877
+ ```javascript
878
+ sock.sendMessage(jid, {
879
+ document: {
880
+ url: './path/to/document.pdf'
881
+ },
882
+ mimetype: 'application/pdf',
883
+ caption: '✨ My work!'
884
+ }, {
885
+ quoted: message
886
+ })
887
+ ```
888
+
889
+ #### 🖼️ Album (Image & Video)
890
+
891
+ ```javascript
892
+ sock.sendMessage(jid, {
893
+ album: [{
894
+ image: {
895
+ url: './path/to/image.jpg'
896
+ },
897
+ caption: '1st image'
898
+ }, {
899
+ video: {
900
+ url: './path/to/video.mp4'
901
+ },
902
+ caption: '1st video'
903
+ }, {
904
+ image: {
905
+ url: './path/to/image.jpg'
906
+ },
907
+ caption: '2nd image'
908
+ }, {
909
+ video: {
910
+ url: './path/to/video.mp4'
911
+ },
912
+ caption: '2nd video'
913
+ }]
914
+ }, {
915
+ quoted: message
916
+ })
917
+ ```
918
+
919
+ #### 📦 Sticker Pack
920
+
921
+ > [!IMPORTANT]
922
+ > If `sharp` or `@napi-rs/image` is not installed, the `cover` and `stickers` must already be in WebP format.
923
+
924
+ ```javascript
925
+ sock.sendMessage(jid, {
926
+ cover: {
927
+ url: './path/to/image.webp'
928
+ },
929
+ stickers: [{
930
+ data: {
931
+ url: './path/to/image.webp'
932
+ }
933
+ }, {
934
+ data: {
935
+ url: './path/to/image.webp'
936
+ }
937
+ }, {
938
+ data: {
939
+ url: './path/to/image.webp'
940
+ }
941
+ }],
942
+ name: '📦 My Sticker Pack',
943
+ publisher: '🌟 kaels',
944
+ description: '@kaels/casileys'
945
+ }, {
946
+ quoted: message
947
+ })
948
+ ```
949
+
950
+ ### 👉🏻 Sending Interactive Messages
951
+
952
+ #### 🔘 Buttons
953
+
954
+ ```javascript
955
+ // --- Regular buttons message
956
+ sock.sendMessage(jid, {
957
+ text: '👆🏻 Buttons!',
958
+ footer: '@kaels/casileys',
959
+ buttons: [{
960
+ text: '👋🏻 SignUp',
961
+ id: '#SignUp'
962
+ }]
963
+ }, {
964
+ quoted: message
965
+ })
966
+
967
+ // --- Buttons with Media & Native Flow
968
+ sock.sendMessage(jid, {
969
+ image: {
970
+ url: './path/to/image.jpg'
971
+ },
972
+ caption: '👆🏻 Buttons and Native Flow!',
973
+ footer: '@kaels/casileys',
974
+ buttons: [{
975
+ text: '👋🏻 Rating',
976
+ id: '#Rating'
977
+ }, {
978
+ text: '📋 Select',
979
+ sections: [{
980
+ title: '✨ Section 1',
981
+ rows: [{
982
+ header: '',
983
+ title: '💭 Secret Ingredient',
984
+ description: '',
985
+ id: '#SecretIngredient'
986
+ }]
987
+ }, {
988
+ title: '✨ Section 2',
989
+ highlight_label: '🔥 Popular',
990
+ rows: [{
991
+ header: '',
992
+ title: '🏷️ Coupon',
993
+ description: '',
994
+ id: '#CouponCode'
995
+ }]
996
+ }]
997
+ }]
998
+ }, {
999
+ quoted: message
1000
+ })
1001
+ ```
1002
+
1003
+ #### 📋 List
1004
+
1005
+ > [!NOTE]
1006
+ > It only works in private chat (`@s.whatsapp.net`).
1007
+
1008
+ ```javascript
1009
+ sock.sendMessage(jid, {
1010
+ text: '📋 List!',
1011
+ footer: '@kaels/casileys',
1012
+ buttonText: '📋 Select',
1013
+ title: '👋🏻 Hello',
1014
+ sections: [{
1015
+ title: '🚀 Menu 1',
1016
+ rows: [{
1017
+ title: '✨ AI',
1018
+ description: '',
1019
+ rowId: '#AI'
1020
+ }]
1021
+ }, {
1022
+ title: '🌱 Menu 2',
1023
+ rows: [{
1024
+ title: '🔍 Search',
1025
+ description: '',
1026
+ rowId: '#Search'
1027
+ }]
1028
+ }]
1029
+ }, {
1030
+ quoted: message
1031
+ })
1032
+ ```
1033
+
1034
+ #### 🗄️ Interactive
1035
+
1036
+ ```javascript
1037
+ // --- Native Flow
1038
+ sock.sendMessage(jid, {
1039
+ image: {
1040
+ url: './path/to/image.jpg'
1041
+ },
1042
+ caption: '🗄️️ Interactive!',
1043
+ footer: '@kaels/casileys',
1044
+ optionText: '👉🏻 Select Options', // --- Optional, wrap all native flow into a single list
1045
+ optionTitle: '📄 Select Options', // --- Optional
1046
+ offerText: '🏷️ Newest Coupon!', // --- Optional, add an offer into message
1047
+ offerCode: '@kaels/casileys', // --- Optional
1048
+ offerUrl: 'https://www.npmjs.com/package/@kaels/casileys', // --- Optional
1049
+ offerExpiration: Date.now() + 3_600_000, // --- Optional
1050
+ nativeFlow: [{
1051
+ text: '👋🏻 Greeting',
1052
+ id: '#Greeting',
1053
+ icon: 'review' // --- Optional
1054
+ }, {
1055
+ text: '📞 Call',
1056
+ call: '628123456789'
1057
+ }, {
1058
+ text: '📋 Copy',
1059
+ copy: '@kaels/casileys'
1060
+ }, {
1061
+ text: '🌐 Source',
1062
+ url: 'https://www.npmjs.com/package/@kaels/casileys',
1063
+ useWebview: true // --- Optional
1064
+ }, {
1065
+ text: '📋 Select',
1066
+ sections: [{
1067
+ title: '✨ Section 1',
1068
+ rows: [{
1069
+ header: '',
1070
+ title: '🏷️ Coupon',
1071
+ description: '',
1072
+ id: '#CouponCode'
1073
+ }]
1074
+ }, {
1075
+ title: '✨ Section 2',
1076
+ highlight_label: '🔥 Popular',
1077
+ rows: [{
1078
+ header: '',
1079
+ title: '💭 Secret Ingredient',
1080
+ description: '',
1081
+ id: '#SecretIngredient'
1082
+ }]
1083
+ }],
1084
+ icon: 'default' // --- Optional
1085
+ }],
1086
+ interactiveAsTemplate: false, // --- Optional, wrap the interactive message into a template
1087
+ }, {
1088
+ quoted: message
1089
+ })
1090
+
1091
+ // --- Carousel & Native Flow
1092
+ sock.sendMessage(jid, {
1093
+ text: '🗂️ Interactive with Carousel!',
1094
+ footer: '@kaels/casileys',
1095
+ cards: [{
1096
+ image: {
1097
+ url: './path/to/image.jpg'
1098
+ },
1099
+ caption: '🖼️ Image 1',
1100
+ footer: '🏷️️ Pinterest',
1101
+ nativeFlow: [{
1102
+ text: '🌐 Source',
1103
+ url: 'https://www.npmjs.com/package/@kaels/casileys',
1104
+ useWebview: true
1105
+ }]
1106
+ }, {
1107
+ image: {
1108
+ url: './path/to/image.jpg'
1109
+ },
1110
+ caption: '🖼️ Image 2',
1111
+ footer: '🏷️ Pinterest',
1112
+ offerText: '🏷️ New Coupon!',
1113
+ offerCode: '@kaels/casileys',
1114
+ offerUrl: 'https://www.npmjs.com/package/@kaels/casileys',
1115
+ offerExpiration: Date.now() + 3_600_000,
1116
+ nativeFlow: [{
1117
+ text: '🌐 Source',
1118
+ url: 'https://www.npmjs.com/package/@kaels/casileys'
1119
+ }]
1120
+ }, {
1121
+ image: {
1122
+ url: './path/to/image.jpg'
1123
+ },
1124
+ caption: '🖼️ Image 3',
1125
+ footer: '🏷️ Pinterest',
1126
+ optionText: '👉🏻 Select Options',
1127
+ optionTitle: '👉🏻 Select Options',
1128
+ offerText: '🏷️ New Coupon!',
1129
+ offerCode: '@kaels/casileys',
1130
+ offerUrl: 'https://www.npmjs.com/package/@kaels/casileys',
1131
+ offerExpiration: Date.now() + 3_600_000,
1132
+ nativeFlow: [{
1133
+ text: '🛒 Product',
1134
+ id: '#Product',
1135
+ icon: 'default'
1136
+ }, {
1137
+ text: '🌐 Source',
1138
+ url: 'https://www.npmjs.com/package/@kaels/casileys'
1139
+ }]
1140
+ }]
1141
+ }, {
1142
+ quoted: message
1143
+ })
1144
+
1145
+ // --- Native Flow with Audio in the Footer
1146
+ sock.sendMessage(jid, {
1147
+ text: '🔈 Music in the footer!',
1148
+ audioFooter: {
1149
+ url: './path/to/audio.mp3'
1150
+ }, // --- Like other media upload methods, buffers and streams are supported
1151
+ nativeFlow: [{
1152
+ text: '👍🏻 Good, next',
1153
+ id: '#Next',
1154
+ icon: 'review'
1155
+ }, {
1156
+ text: '👎🏻 Skip',
1157
+ id: '#Skip',
1158
+ icon: 'default'
1159
+ }]
1160
+ }, {
1161
+ quoted: message
1162
+ })
1163
+ ```
1164
+
1165
+ #### 🫙 Hydrated Template
1166
+
1167
+ ```javascript
1168
+ sock.sendMessage(jid, {
1169
+ title: '👋🏻 Hello',
1170
+ image: {
1171
+ url: './path/to/image.jpg'
1172
+ },
1173
+ caption: '🫙 Template!',
1174
+ footer: '@kaels/casileys',
1175
+ templateButtons: [{
1176
+ text: '👉🏻 Tap Here',
1177
+ id: '#Order'
1178
+ }, {
1179
+ text: '🌐 Source',
1180
+ url: 'https://www.npmjs.com/package/@kaels/casileys'
1181
+ }, {
1182
+ text: '📞 Call',
1183
+ call: '628123456789'
1184
+ }]
1185
+ }, {
1186
+ quoted: message
1187
+ })
1188
+ ```
1189
+
1190
+ ### 💳 Sending Payment Messages
1191
+
1192
+ #### ➕ Invite Payment
1193
+
1194
+ ```javascript
1195
+ sock.sendMessage(jid, {
1196
+ paymentInviteServiceType: 3 // 1, 2, or 3
1197
+ })
1198
+ ```
1199
+
1200
+ #### 🧾 Invoice
1201
+
1202
+ > [!NOTE]
1203
+ > Invoice message are not supported yet.
1204
+
1205
+ ```javascript
1206
+ sock.sendMessage(jid, {
1207
+ image: {
1208
+ url: './path/to/image.jpg'
1209
+ },
1210
+ invoiceNote: '🏷️ Invoice'
1211
+ })
1212
+ ```
1213
+
1214
+ #### 🛍️ Order
1215
+
1216
+ ```javascript
1217
+ sock.sendMessage(chat, {
1218
+ orderText: '🛍️ Order',
1219
+ thumbnail: fs.readFileSync('./path/to/image.jpg') // --- Must in buffer format
1220
+ }, {
1221
+ quoted: message
1222
+ })
1223
+ ```
1224
+
1225
+ #### 💳 Request Payment
1226
+
1227
+ ```javascript
1228
+ sock.sendMessage(jid, {
1229
+ text: '💳 Request Payment',
1230
+ requestPaymentFrom: '0@s.whatsapp.net'
1231
+ })
1232
+ ```
1233
+
1234
+ ### 👁️ Other Message Options
1235
+
1236
+ #### 🤖 AI Icon
1237
+
1238
+ > [!NOTE]
1239
+ > It only works in private chat (`@s.whatsapp.net`).
1240
+
1241
+ ```javascript
1242
+ sock.sendMessage(jid, {
1243
+ image: {
1244
+ url: './path/to/image.jpg'
1245
+ },
1246
+ caption: '🤖 With AI icon!',
1247
+ ai: true
1248
+ }, {
1249
+ quoted: message
1250
+ })
1251
+ ```
1252
+
1253
+ #### 🕒 Ephemeral
1254
+
1255
+ > [!NOTE]
1256
+ > Wrap message into `ephemeralMessage`
1257
+
1258
+ ```javascript
1259
+ sock.sendMessage(jid, {
1260
+ image: {
1261
+ url: './path/to/image.jpg'
1262
+ },
1263
+ caption: '👁️ Ephemeral',
1264
+ ephemeral: true
1265
+ })
1266
+ ```
1267
+
1268
+ #### 📰 External Ad Reply
1269
+
1270
+ > [!NOTE]
1271
+ > Add an ad thumbnail to messages (may not be displayed on some WhatsApp versions).
1272
+
1273
+ ```javascript
1274
+ sock.sendMessage(jid, {
1275
+ text: '📰 External Ad Reply',
1276
+ externalAdReply: {
1277
+ title: '📝 Did you know?',
1278
+ body: '❓ I dont know',
1279
+ thumbnail: fs.readFileSync('./path/to/image.jpg'), // --- Must in buffer format
1280
+ largeThumbnail: false, // --- Or true for bigger thumbnail
1281
+ url: 'https://www.npmjs.com/package/@kaels/casileys' // --- Optional, used for WhatsApp internal thumbnail caching and direct URL
1282
+ }
1283
+ }, {
1284
+ quoted: message
1285
+ })
1286
+ ```
1287
+
1288
+ #### 🧑‍🧑‍🧒 Group Status
1289
+
1290
+ > [!NOTE]
1291
+ > It only works in group chat (`@g.us`)
1292
+
1293
+ ```javascript
1294
+ sock.sendMessage(jid, {
1295
+ image: {
1296
+ url: './path/to/image.jpg'
1297
+ },
1298
+ caption: '👥 Group Status!',
1299
+ groupStatus: true
1300
+ })
1301
+ ```
1302
+
1303
+ #### 🐱 Lottie Sticker
1304
+
1305
+ > [!NOTE]
1306
+ > Wrap message into `lottieStickerMessage`
1307
+
1308
+ ```javascript
1309
+ sock.sendMessage(jid, {
1310
+ sticker: {
1311
+ url: './path/to/sticker.webp'
1312
+ },
1313
+ isLottie: true
1314
+ })
1315
+ ```
1316
+
1317
+ #### 🧩 Raw
1318
+
1319
+ ```javascript
1320
+ sock.sendMessage(jid, {
1321
+ extendedTextMessage: {
1322
+ text: '📃 Built manually from scratch using the raw WhatsApp proto structure',
1323
+ contextInfo: {
1324
+ externalAdReply: {
1325
+ title: '@kaels/casileys',
1326
+ thumbnail: fs.readFileSync('./path/to/image.jpg'),
1327
+ sourceApp: 'whatsapp',
1328
+ showAdAttribution: true,
1329
+ mediaType: 1
1330
+ }
1331
+ }
1332
+ },
1333
+ raw: true
1334
+ }, {
1335
+ quoted: message
1336
+ })
1337
+ ```
1338
+
1339
+ #### 🏷️ Secure Meta Service Label
1340
+
1341
+ ```javascript
1342
+ sock.sendMessage(jid, {
1343
+ text: '🏷️ Just a label!',
1344
+ secureMetaServiceLabel: true
1345
+ })
1346
+ ```
1347
+
1348
+ #### 📑 Spoiler
1349
+
1350
+ > [!NOTE]
1351
+ > Wrap message into `spoilerMessage`
1352
+
1353
+ ```javascript
1354
+ sock.sendMessage(jid, {
1355
+ image: {
1356
+ url: './path/to/image.jpg'
1357
+ },
1358
+ caption: '❔ Spoiler',
1359
+ spoiler: true
1360
+ })
1361
+ ```
1362
+
1363
+ #### 👁️ View Once
1364
+
1365
+ > [!NOTE]
1366
+ > Wrap message into `viewOnceMessage`
1367
+
1368
+ ```javascript
1369
+ sock.sendMessage(jid, {
1370
+ image: {
1371
+ url: './path/to/image.jpg'
1372
+ },
1373
+ caption: '👁️ View Once',
1374
+ viewOnce: true
1375
+ })
1376
+ ```
1377
+
1378
+ #### 👁️ View Once V2
1379
+
1380
+ > [!NOTE]
1381
+ > Wrap message into `viewOnceMessageV2`
1382
+
1383
+ ```javascript
1384
+ sock.sendMessage(jid, {
1385
+ image: {
1386
+ url: './path/to/image.jpg'
1387
+ },
1388
+ caption: '👁️ View Once V2',
1389
+ viewOnceV2: true
1390
+ })
1391
+ ```
1392
+
1393
+ #### 👁️ View Once V2 Extension
1394
+
1395
+ > [!NOTE]
1396
+ > Wrap message into `viewOnceMessageV2Extension`
1397
+
1398
+ ```javascript
1399
+ sock.sendMessage(jid, {
1400
+ image: {
1401
+ url: './path/to/image.jpg'
1402
+ },
1403
+ caption: '👁️ View Once V2 Extension',
1404
+ viewOnceV2Extension: true
1405
+ })
1406
+ ```
1407
+
1408
+ ### ♻️ Modify Messages
1409
+
1410
+ #### 🗑️ Delete Messages
1411
+
1412
+ ```javascript
1413
+ sock.sendMessage(jid, {
1414
+ delete: message.key
1415
+ })
1416
+ ```
1417
+
1418
+ #### ✏️ Edit Messages
1419
+
1420
+ ```javascript
1421
+ // --- Edit plain text
1422
+ sock.sendMessage(jid, {
1423
+ text: '✨ I mean, nice!',
1424
+ edit: message.key
1425
+ })
1426
+
1427
+ // --- Edit media messages caption
1428
+ sock.sendMessage(jid, {
1429
+ caption: '✨ I mean, here is the image!',
1430
+ edit: message.key
1431
+ })
1432
+ ```
1433
+
1434
+ ### 🧰 Additional Contents
1435
+
1436
+ #### 🏷️ Find User ID (JID|PN/LID)
1437
+
1438
+ > [!NOTE]
1439
+ > The ID must contain numbers only (no +, (), or -) and must include the country code with WhatsApp ID format.
1440
+
1441
+ ```javascript
1442
+ // --- PN (Phone Number)
1443
+ const phoneNumber = '6281111111111@s.whatsapp.net'
1444
+
1445
+ const ids = await sock.findUserId(phoneNumber)
1446
+
1447
+ console.log('🏷️ Got user ID', ':', ids)
1448
+
1449
+ // --- LID (Local Identifier)
1450
+ const lid = '43411111111111@lid'
1451
+
1452
+ const ids = await sock.findUserId(lid)
1453
+
1454
+ console.log('🏷️ Got user ID', ':', ids)
1455
+
1456
+ // --- Output
1457
+ // {
1458
+ // phoneNumber: '6281111111111@s.whatsapp.net',
1459
+ // lid: '43411111111111@lid'
1460
+ // }
1461
+ // --- Output when failed
1462
+ // {
1463
+ // phoneNumber: '6281111111111@s.whatsapp.net',
1464
+ // lid: undefined
1465
+ // }
1466
+ // --- Same output shape regardless of input type
1467
+ ```
1468
+
1469
+ #### 🔑 Request Custom Pairing Code
1470
+
1471
+ > [!NOTE]
1472
+ > The phone number must contain numbers only (no +, (), or -) and must include the country code.
1473
+
1474
+ ```javascript
1475
+ const phoneNumber = '6281111111111'
1476
+ const customPairingCode = 'STARFALL'
1477
+
1478
+ await sock.requestPairingCode(phoneNumber, customPairingCode)
1479
+
1480
+ console.log('🔗 Pairing code', ':', customPairingCode)
1481
+ ```
1482
+
1483
+ #### 🖼️ Image Processing
1484
+
1485
+ > [!NOTE]
1486
+ > Automatically use available image processing library: `sharp`, `@napi-rs/image`, or `jimp`
1487
+
1488
+ ```javascript
1489
+ import { getImageProcessingLibrary } from '@kaels/casileys'
1490
+ import { readFile } from 'fs/promises'
1491
+
1492
+ const lib = await getImageProcessingLibrary()
1493
+
1494
+ const bufferOrFilePath = './path/to/image.jpg'
1495
+ const width = 512
1496
+
1497
+ let output
1498
+
1499
+ // --- If sharp installed
1500
+ if (lib.sharp?.default) {
1501
+ const img = lib.sharp.default(bufferOrFilePath)
1502
+
1503
+ output = await img.resize(width)
1504
+ .jpeg({ quality: 80 })
1505
+ .toBuffer()
1506
+ }
1507
+
1508
+ // --- If @napi-rs/image installed
1509
+ else if (lib.image?.Transformer) {
1510
+ // --- Must in buffer format
1511
+ const inputBuffer = Buffer.isBuffer(bufferOrFilePath)
1512
+ ? bufferOrFilePath
1513
+ : await readFile(bufferOrFilePath)
1514
+
1515
+ const img = new lib.image.Transformer(inputBuffer)
1516
+
1517
+ output = await img.resize(width, undefined, 0)
1518
+ .jpeg(50)
1519
+ }
1520
+
1521
+ // --- If jimp installed
1522
+ else if (lib.jimp?.Jimp) {
1523
+ const img = await lib.jimp.Jimp.read(bufferOrFilePath)
1524
+
1525
+ output = await img
1526
+ .resize({ w: width, mode: lib.jimp.ResizeStrategy.BILINEAR })
1527
+ .getBuffer('image/jpeg', { quality: 50 })
1528
+ }
1529
+
1530
+ // --- Fallback
1531
+ else {
1532
+ throw new Error('No image processing available')
1533
+ }
1534
+
1535
+ console.log('✅ Process completed!')
1536
+ console.dir(output, { depth: null })
1537
+ ```
1538
+
1539
+ #### 📣 Newsletter Management
1540
+
1541
+ ```javascript
1542
+ // --- Create a new one
1543
+ sock.newsletterCreate('@kaels/casileys', '📣 Fresh updates weekly')
1544
+
1545
+ // --- Get info
1546
+ const metadata = sock.newsletterMetadata('1231111111111@newsletter')
1547
+ console.dir(metadata, { depth: null })
1548
+
1549
+ // --- Get subscribers count
1550
+ const subscribers = await sock.newsletterSubscribers('1231111111111@newsletter')
1551
+ console.dir(subscribers, { depth: null })
1552
+
1553
+ // --- Follow and Unfollow
1554
+ sock.newsletterFollow('1231111111111@newsletter')
1555
+ sock.newsletterUnfollow('1231111111111@newsletter')
1556
+
1557
+ // --- Mute and Unmute
1558
+ sock.newsletterMute('1231111111111@newsletter')
1559
+ sock.newsletterUnmute('1231111111111@newsletter')
1560
+
1561
+ // --- Demote admin
1562
+ sock.newsletterDemote('1231111111111@newsletter', '6281111111111@s.whatsapp.net')
1563
+
1564
+ // --- Change owner
1565
+ sock.newsletterChangeOwner('1231111111111@newsletter', '6281111111111@s.whatsapp.net')
1566
+
1567
+ // --- Update newsletter
1568
+ sock.newsletterUpdate('1231111111111@newsletter', { name: '@kaels/casileys' })
1569
+
1570
+ // --- Change name
1571
+ sock.newsletterUpdateName('1231111111111@newsletter', '📦 @kaels/casileys')
1572
+
1573
+ // --- Change description
1574
+ sock.newsletterUpdateDescription('1231111111111@newsletter', '📣 Fresh updates weekly')
1575
+
1576
+ // --- Change photo
1577
+ sock.newsletterUpdatePicture('1231111111111@newsletter', {
1578
+ url: 'path/to/image.jpg'
1579
+ })
1580
+
1581
+ // --- Remove photo
1582
+ sock.newsletterRemovePicture('1231111111111@newsletter')
1583
+
1584
+ // --- React to a message
1585
+ sock.newsletterReactMessage('1231111111111@newsletter', '100', '💛')
1586
+
1587
+ // --- Get admin count
1588
+ const count = await sock.newsletterAdminCount('1231111111111@newsletter')
1589
+
1590
+ // --- Get all subscribed newsletters
1591
+ const newsletters = await sock.newsletterSubscribed()
1592
+ console.dir(newsletters, { depth: null })
1593
+
1594
+ // --- Fetch newsletter messages
1595
+ const messages = sock.newsletterFetchMessages('jid', '1231111111111@newsletter', 50, 0, 0)
1596
+ console.dir(messages, { depth: null })
1597
+
1598
+ // --- Delete newsletter
1599
+ sock.newsletterDelete('1231111111111@newsletter')
1600
+ ```
1601
+
1602
+ #### 👥 Group Management
1603
+
1604
+ ```javascript
1605
+ // --- Create a new one and add participants using their JIDs
1606
+ const group = sock.groupCreate('@kaels/casileys', ['628123456789@s.whatsapp.net'])
1607
+ console.dir(group, { depth: null })
1608
+
1609
+ // --- Get info
1610
+ const metadata = await sock.groupMetadata(jid)
1611
+ console.dir(metadata, { depth: null })
1612
+
1613
+ // --- Get group invite code
1614
+ const inviteCode = await sock.groupInviteCode(jid)
1615
+ console.dir(inviteCode, { depth: null })
1616
+
1617
+
1618
+ // --- Revoke invite link
1619
+ sock.groupRevokeInvite(jid)
1620
+
1621
+ // --- Accept group invite
1622
+ sock.groupAcceptInvite(inviteCode)
1623
+
1624
+ // --- Leave group
1625
+ sock.groupLeave(jid)
1626
+
1627
+ // --- Add participants
1628
+ sock.groupParticipantsUpdate(jid, ['628123456789@s.whatsapp.net'], 'add')
1629
+
1630
+ // --- Remove participants
1631
+ sock.groupParticipantsUpdate(jid, ['628123456789@s.whatsapp.net'], 'remove')
1632
+
1633
+ // --- Promote to admin
1634
+ sock.groupParticipantsUpdate(jid, ['628123456789@s.whatsapp.net'], 'promote')
1635
+
1636
+ // --- Demote from admin
1637
+ sock.groupParticipantsUpdate(jid, ['628123456789@s.whatsapp.net'], 'demote')
1638
+
1639
+ // --- Accept join requests
1640
+ sock.groupRequestParticipantsUpdate(jid, ['628123456789@s.whatsapp.net'], 'approve')
1641
+
1642
+ // --- Change name
1643
+ sock.groupUpdateSubject(jid, '📦 @kaels/casileys')
1644
+
1645
+ // --- Change description
1646
+ sock.groupUpdateDescription(jid, 'Updated description')
1647
+
1648
+ // --- Change photo
1649
+ sock.updateProfilePicture(jid, {
1650
+ url: 'path/to/image.jpg'
1651
+ })
1652
+
1653
+ // --- Remove photo
1654
+ sock.removeProfilePicture(jid)
1655
+
1656
+ // --- Set group as admin only for chatting
1657
+ sock.groupSettingUpdate(jid, 'announcement')
1658
+
1659
+ // --- Set group as open to all for chatting
1660
+ sock.groupSettingUpdate(jid, 'not_announcement')
1661
+
1662
+ // --- Set admin only can edit group info
1663
+ sock.groupSettingUpdate(jid, 'locked')
1664
+
1665
+ // --- Set all participants can edit group info
1666
+ sock.groupSettingUpdate(jid, 'unlocked')
1667
+
1668
+ // --- Set admin only can add participants
1669
+ sock.groupMemberAddMode(jid, 'admin_add')
1670
+
1671
+ // --- Set all participants can add participants
1672
+ sock.groupMemberAddMode(jid, 'all_member_add')
1673
+
1674
+ // --- Enable or disable temporary messages with seconds format
1675
+ sock.groupToggleEphemeral(jid, 86400)
1676
+
1677
+ // --- Disable temporary messages
1678
+ sock.groupToggleEphemeral(jid, 0)
1679
+
1680
+ // --- Enable or disable membership approval mode
1681
+ sock.groupJoinApprovalMode(jid, 'on')
1682
+ sock.groupJoinApprovalMode(jid, 'off')
1683
+
1684
+ // --- Get all groups metadata
1685
+ const groups = await sock.groupFetchAllParticipating()
1686
+ console.dir(groups, { depth: null })
1687
+
1688
+ // --- Get pending join requests
1689
+ const requests = await sock.groupRequestParticipantsList(jid)
1690
+ console.dir(requests, { depth: null })
1691
+
1692
+ // --- Get group info from link
1693
+ const group = await sock.groupGetInviteInfo('ABC123456789')
1694
+ console.log('👥 Got group info from invite code', ':', group)
1695
+
1696
+ // --- Update bot member label
1697
+ sock.updateMemberLabel(jid, '@kaels/casileys')
1698
+ ```
1699
+
1700
+ #### 👥 Community Management
1701
+
1702
+ ```javascript
1703
+ // --- Create a new one and add description
1704
+ const community = await sock.communityCreate('@kaels/casileys', '📣 Fresh updates weekly')
1705
+ console.dir(community, { depth: null })
1706
+
1707
+ // --- Create a subgroup for community and add participants using their JIDs
1708
+ const group = await sock.communityCreateGroup('📢 Announcements', ['628123456789@s.whatsapp.net'], communityJid)
1709
+
1710
+ // --- Link an existing group
1711
+ sock.communityLinkGroup(groupJid, communityJid)
1712
+
1713
+ // --- Unlink an existing group
1714
+ sock.communityUnlinkGroup(groupJid, communityJid)
1715
+
1716
+ // --- Get info
1717
+ const metadata = await sock.communityMetadata(jid)
1718
+ console.dir(metadata, { depth: null })
1719
+
1720
+ // --- Get community invite code
1721
+ const inviteCode = await sock.communityInviteCode(jid)
1722
+ console.dir(inviteCode, { depth: null })
1723
+
1724
+ // --- Revoke invite link
1725
+ sock.communityRevokeInvite(jid)
1726
+
1727
+ // --- Accept community invite
1728
+ sock.communityAcceptInvite(inviteCode)
1729
+
1730
+ // --- Leave community
1731
+ sock.communityLeave(jid)
1732
+
1733
+ // --- Accept join requests
1734
+ sock.communityRequestParticipantsUpdate(jid, ['628123456789@s.whatsapp.net'], 'approve')
1735
+
1736
+ // --- Change name
1737
+ sock.communityUpdateSubject(jid, '📦 @kaels/casileys')
1738
+
1739
+ // --- Change description
1740
+ sock.communityUpdateDescription(jid, 'Updated description')
1741
+
1742
+ // --- Set community as admin only for chatting
1743
+ sock.communitySettingUpdate(jid, 'announcement')
1744
+
1745
+ // --- Set community as open to all for chatting
1746
+ sock.communitySettingUpdate(jid, 'not_announcement')
1747
+
1748
+ // --- Set admin only can edit community info
1749
+ sock.communitySettingUpdate(jid, 'locked')
1750
+
1751
+ // --- Set all participants can edit community info
1752
+ sock.communitySettingUpdate(jid, 'unlocked')
1753
+
1754
+ // --- Set admin only can add participants
1755
+ sock.communityMemberAddMode(jid, 'admin_add')
1756
+
1757
+ // --- Set all participants can add participants
1758
+ sock.communityMemberAddMode(jid, 'all_member_add')
1759
+
1760
+ // --- Enable or disable temporary messages with seconds format
1761
+ sock.communityToggleEphemeral(jid, 86400)
1762
+
1763
+ // --- Disable temporary messages
1764
+ sock.communityToggleEphemeral(jid, 0)
1765
+
1766
+ // --- Enable or disable membership approval mode
1767
+ sock.communityJoinApprovalMode(jid, 'on')
1768
+ sock.communityJoinApprovalMode(jid, 'off')
1769
+
1770
+ // --- Get all communities metadata
1771
+ const communities = await sock.communityFetchAllParticipating()
1772
+ console.dir(communities, { depth: null })
1773
+
1774
+ // --- Get all community linked groups
1775
+ const linked = await sock.communityFetchLinkedGroups(jid)
1776
+ console.dir(linked, { depth: null })
1777
+
1778
+ // --- Get pending join requests
1779
+ const requests = await sock.communityRequestParticipantsList(jid)
1780
+ console.dir(requests, { depth: null })
1781
+
1782
+ // --- Get community info from link
1783
+ const community = await sock.communityGetInviteInfo('ABC123456789')
1784
+ console.log('👥 Got community info from invite code', ':', community)
1785
+ ```
1786
+
1787
+ #### 👤 Profile Management
1788
+
1789
+ ```javascript
1790
+ // --- Get user profile picture
1791
+ const url = await sock.profilePictureUrl(jid, 'image')
1792
+ console.log('🖼️ Got user profile url', url)
1793
+
1794
+ // --- Update profile picture
1795
+ sock.updateProfilePicture(jid, buffer)
1796
+ sock.updateProfilePicture(jid, { url })
1797
+
1798
+ // --- Remove profile picture
1799
+ sock.removeProfilePicture(jid)
1800
+
1801
+ // --- Update profile name
1802
+ sock.updateProfileName('My Name')
1803
+
1804
+ // --- Update profile status
1805
+ sock.updateProfileStatus('Available')
1806
+
1807
+ // --- Presence
1808
+ sock.sendPresenceUpdate('available', jid)
1809
+ sock.presenceSubscribe(jid)
1810
+
1811
+ // --- Read receipts
1812
+ sock.readMessages([message.key])
1813
+ sock.sendReceipt(jid, participant, [messageId], 'read')
1814
+
1815
+ // --- Block user
1816
+ sock.updateBlockStatus(jid, 'block')
1817
+
1818
+ // --- Unblock user
1819
+ sock.updateBlockStatus(jid, 'unblock')
1820
+
1821
+ // --- Fetch blocklist
1822
+ const blocked = await sock.fetchBlocklist()
1823
+ console.dir(blocked, { depth: null })
1824
+
1825
+ // --- Modify chats
1826
+ sock.chatModify({
1827
+ archive: true,
1828
+ lastMessageOrig: message,
1829
+ lastMessage: message
1830
+ }, jid)
1831
+
1832
+ // --- Star messages
1833
+ sock.star(jid, [{ id: messageId, fromMe: true }], true)
1834
+
1835
+ // --- Contact
1836
+ sock.addOrEditContact(jid, { displayName: 'Starseed' })
1837
+ sock.removeContact(jid)
1838
+
1839
+ // --- Label
1840
+ sock.addChatLabel(jid, labelId)
1841
+ sock.removeChatLabel(jid, labelId)
1842
+ sock.addMessageLabel(jid, messageId, labelId)
1843
+
1844
+ // --- App state sync
1845
+ sock.resyncAppState(['regular', 'critical_block'], true)
1846
+
1847
+ // --- Get business profile
1848
+ const profile = await sock.getBusinessProfile(jid)
1849
+ console.dir(profile, { depth: null })
1850
+ ```
1851
+
1852
+ #### 🛒 Business Management
1853
+
1854
+ ```javascript
1855
+ // --- Create a new product
1856
+ const product = await sock.productCreate({
1857
+ name: '🧩 Starseed (Premium)',
1858
+ description: 'Get a full version of Starseed!',
1859
+ price: 100000,
1860
+ currency: 'IDR',
1861
+ originCountryCode: 'ID',
1862
+ images: [
1863
+ bufferImage,
1864
+ {
1865
+ url: './path/to/image.jpg'
1866
+ }
1867
+ ]
1868
+ })
1869
+ console.dir(product, { depth: null })
1870
+
1871
+ // --- Update product
1872
+ await sock.productUpdate(productId, {
1873
+ name: '🧩 Starseed (Premium)',
1874
+ description: 'Get a full version of Starseed with more features!',
1875
+ price: 75000,
1876
+ currency: 'IDR',
1877
+ images: [
1878
+ {
1879
+ url: './path/to/image.jpg'
1880
+ }
1881
+ ]
1882
+ })
1883
+
1884
+ // --- Delete product
1885
+ sock.productDelete([productId])
1886
+
1887
+ // --- Get catalog info
1888
+ const { products, nextPageCursor } = await sock.getCatalog({
1889
+ jid: '628123456789@s.whatsapp.net',
1890
+ limit: 10
1891
+ })
1892
+
1893
+ // --- Get collections
1894
+ const collections = await sock.getCollections('628123456789@s.whatsapp.net', 10)
1895
+ console.dir(collections, { depth: null })
1896
+
1897
+ // --- Get order info
1898
+ const order = await sock.getOrderDetails(orderId, tokenBase64)
1899
+ console.dir(order, { depth: null })
1900
+
1901
+ // --- Update business profile
1902
+ await sock.updateBusinessProfile({
1903
+ address: 'Jakarta, Indonesia',
1904
+ description: '🛒 Official Starseed Store',
1905
+ websites: ['https://www.npmjs.com/package/@kaels/casileys'],
1906
+ email: 'more-more@gmail.com',
1907
+ hours: {
1908
+ timezone: 'Asia/Jakarta',
1909
+ days: [{ day: 'mon', mode: 'open_24h' }]
1910
+ }
1911
+ })
1912
+
1913
+ // --- Update cover
1914
+ sock.updateCoverPhoto({
1915
+ url: './path/to/image.jpg'
1916
+ })
1917
+
1918
+ // --- Remove cover
1919
+ sock.removeCoverPhoto(coverId)
1920
+
1921
+ // --- Update quick replies
1922
+ sock.addOrEditQuickReply({
1923
+ shortcut: 'hello',
1924
+ message: 'Hello from business account',
1925
+ })
1926
+
1927
+ // --- Remove quick reply
1928
+ sock.removeQuickReply(timestamp)
1929
+ ```
1930
+
1931
+ #### 🔐 Privacy Management
1932
+
1933
+ ```javascript
1934
+ // --- Update last seen privacy
1935
+ sock.updateLastSeenPrivacy('all')
1936
+ sock.updateLastSeenPrivacy('contacts')
1937
+ sock.updateLastSeenPrivacy('contact_blacklist')
1938
+ sock.updateLastSeenPrivacy('nobody')
1939
+
1940
+ // --- Update online privacy
1941
+ sock.updateOnlinePrivacy('all')
1942
+ sock.updateOnlinePrivacy('match_last_seen')
1943
+
1944
+ // --- Update profile picture privacy
1945
+ sock.updateProfilePicturePrivacy('contacts')
1946
+
1947
+ // --- Update status privacy
1948
+ sock.updateStatusPrivacy('contacts')
1949
+
1950
+ // --- Update read receipts privacy
1951
+ sock.updateReadReceiptsPrivacy('all')
1952
+ sock.updateReadReceiptsPrivacy('none')
1953
+
1954
+ // --- Update groups add privacy
1955
+ sock.updateGroupsAddPrivacy('all')
1956
+ sock.updateGroupsAddPrivacy('contacts')
1957
+
1958
+ // --- Update messages privacy
1959
+ sock.updateMessagesPrivacy('all')
1960
+ sock.updateMessagesPrivacy('contacts')
1961
+ sock.updateMessagesPrivacy('nobody')
1962
+
1963
+ // --- Update call privacy
1964
+ sock.updateCallPrivacy('everyone')
1965
+
1966
+ // --- Update default disappearing mode
1967
+ sock.updateDefaultDisappearingMode(86400)
1968
+
1969
+ // --- Update link previews privacy
1970
+ sock.updateDisableLinkPreviewsPrivacy(true)
1971
+ ```
1972
+
1973
+ #### 📡 Events
1974
+
1975
+ ```javascript
1976
+ sock.ev.on('connection.update', (update) => {})
1977
+ sock.ev.on('creds.update', (update) => {})
1978
+ sock.ev.on('messaging-history.set', (update) => {})
1979
+ sock.ev.on('messaging-history.status', (update) => {})
1980
+ sock.ev.on('chats.upsert', (update) => {})
1981
+ sock.ev.on('chats.update', (update) => {})
1982
+ sock.ev.on('chats.delete', (update) => {})
1983
+ sock.ev.on('chats.lock', (update) => {})
1984
+ sock.ev.on('lid-mapping.update', (update) => {})
1985
+ sock.ev.on('presence.update', (update) => {})
1986
+ sock.ev.on('contacts.upsert', (update) => {})
1987
+ sock.ev.on('contacts.update', (update) => {})
1988
+ sock.ev.on('messages.delete', (update) => {})
1989
+ sock.ev.on('messages.update', (update) => {})
1990
+ sock.ev.on('messages.media-update', (update) => {})
1991
+ sock.ev.on('messages.upsert', (update) => {})
1992
+ sock.ev.on('messages.reaction', (update) => {})
1993
+ sock.ev.on('message-receipt.update', (update) => {})
1994
+ sock.ev.on('groups.upsert', (update) => {})
1995
+ sock.ev.on('groups.update', (update) => {})
1996
+ sock.ev.on('group-participants.update', (update) => {})
1997
+ sock.ev.on('group.join-request', (update) => {})
1998
+ sock.ev.on('group.member-tag.update', (update) => {})
1999
+ sock.ev.on('blocklist.set', (update) => {})
2000
+ sock.ev.on('blocklist.update', (update) => {})
2001
+ sock.ev.on('call', (update) => {})
2002
+ sock.ev.on('labels.edit', (update) => {})
2003
+ sock.ev.on('labels.association', (update) => {})
2004
+ sock.ev.on('newsletter.reaction', (update) => {})
2005
+ sock.ev.on('newsletter.view', (update) => {})
2006
+ sock.ev.on('newsletter-participants.update', (update) => {})
2007
+ sock.ev.on('newsletter-settings.update', (update) => {})
2008
+ sock.ev.on('settings.update', (update) => {})
2009
+ ```
2010
+
2011
+ ### 🚀 Try the Bot
2012
+
2013
+ A fast, lightweight, and modular WhatsApp bot built with [@kaels/casileys](https://www.npmjs.com/package/@kaels/casileys).
2014
+ Perfect for managing groups, moderating chats, and adding fun with quiz games and handy tools.
2015
+
2016
+ 👉🏻 [@itsliaaa/starseed](https://github.com/itsliaaa/starseed#readme)
2017
+
2018
+ ### 📦 Fork Base
2019
+
2020
+ This fork is based on [Baileys (GitHub)](https://github.com/WhiskeySockets/Baileys)
2021
+
2022
+ ### 📣 Credits
2023
+
2024
+ Full credit is attributed to the original maintainers and contributors of Baileys:
2025
+ - [purpshell](https://github.com/purpshell)
2026
+ - [jlucaso1](https://github.com/jlucaso1)
2027
+ - [adiwajshing](https://github.com/adiwajshing)
2028
+
2029
+ This fork includes additional enhancements and modifications by [kaels](https://github.com/itsliaaa)
2030
+
2031
+ Special thanks to [itsreimau](https://github.com/itsreimau) for the fix to the `updateBlockStatus` implementation.
2032
+
2033
+ > [!CAUTION]