@neoxr/zapo 1.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 (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +713 -0
  3. package/lib/core/binding.js +2 -0
  4. package/lib/core/binding.js.map +1 -0
  5. package/lib/core/connection.js +2 -0
  6. package/lib/core/connection.js.map +1 -0
  7. package/lib/core/instance.js +2 -0
  8. package/lib/core/instance.js.map +1 -0
  9. package/lib/core/message-util.js +2 -0
  10. package/lib/core/message-util.js.map +1 -0
  11. package/lib/core/message.js +2 -0
  12. package/lib/core/message.js.map +1 -0
  13. package/lib/core/polyfill.js +2 -0
  14. package/lib/core/polyfill.js.map +1 -0
  15. package/lib/core/private.js +2 -0
  16. package/lib/core/private.js.map +1 -0
  17. package/lib/core/serialize.js +2 -0
  18. package/lib/core/serialize.js.map +1 -0
  19. package/lib/core/storage.js +2 -0
  20. package/lib/core/storage.js.map +1 -0
  21. package/lib/index.js +74 -0
  22. package/lib/index.js.map +1 -0
  23. package/lib/listeners/group-update.js +2 -0
  24. package/lib/listeners/group-update.js.map +1 -0
  25. package/lib/listeners/index.js +2 -0
  26. package/lib/listeners/index.js.map +1 -0
  27. package/lib/listeners/messages-inbound.js +2 -0
  28. package/lib/listeners/messages-inbound.js.map +1 -0
  29. package/lib/listeners/messages-outbound.js +2 -0
  30. package/lib/listeners/messages-outbound.js.map +1 -0
  31. package/lib/listeners/messages-receipt.js +2 -0
  32. package/lib/listeners/messages-receipt.js.map +1 -0
  33. package/lib/listeners/presence.js +2 -0
  34. package/lib/listeners/presence.js.map +1 -0
  35. package/lib/memory/index.js +2 -0
  36. package/lib/memory/index.js.map +1 -0
  37. package/lib/memory/localy-store.js +2 -0
  38. package/lib/memory/localy-store.js.map +1 -0
  39. package/lib/memory/temporary-store.js +2 -0
  40. package/lib/memory/temporary-store.js.map +1 -0
  41. package/lib/proxy/index.js +2 -0
  42. package/lib/proxy/index.js.map +1 -0
  43. package/lib/proxy/proxy-json.js +2 -0
  44. package/lib/proxy/proxy-json.js.map +1 -0
  45. package/lib/proxy/proxy-mongo.js +2 -0
  46. package/lib/proxy/proxy-mongo.js.map +1 -0
  47. package/lib/proxy/proxy-mysql.js +2 -0
  48. package/lib/proxy/proxy-mysql.js.map +1 -0
  49. package/lib/proxy/proxy-postgresql.js +2 -0
  50. package/lib/proxy/proxy-postgresql.js.map +1 -0
  51. package/lib/proxy/proxy-redis.js +2 -0
  52. package/lib/proxy/proxy-redis.js.map +1 -0
  53. package/lib/proxy/proxy-sqlite.js +2 -0
  54. package/lib/proxy/proxy-sqlite.js.map +1 -0
  55. package/lib/types/index.js +2 -0
  56. package/lib/types/index.js.map +1 -0
  57. package/lib/utils/caching.js +2 -0
  58. package/lib/utils/caching.js.map +1 -0
  59. package/lib/utils/chiper.js +2 -0
  60. package/lib/utils/chiper.js.map +1 -0
  61. package/lib/utils/converter.js +2 -0
  62. package/lib/utils/converter.js.map +1 -0
  63. package/lib/utils/cooldown.js +2 -0
  64. package/lib/utils/cooldown.js.map +1 -0
  65. package/lib/utils/functions.js +2 -0
  66. package/lib/utils/functions.js.map +1 -0
  67. package/lib/utils/loader.js +2 -0
  68. package/lib/utils/loader.js.map +1 -0
  69. package/lib/utils/logger.js +2 -0
  70. package/lib/utils/logger.js.map +1 -0
  71. package/lib/utils/resolver.js +2 -0
  72. package/lib/utils/resolver.js.map +1 -0
  73. package/lib/utils/security.js +2 -0
  74. package/lib/utils/security.js.map +1 -0
  75. package/lib/utils/spam.js +2 -0
  76. package/lib/utils/spam.js.map +1 -0
  77. package/package.json +74 -0
package/README.md ADDED
@@ -0,0 +1,713 @@
1
+ ## SIMPLICITY WHATSAPP BOT
2
+
3
+ > `@neoxr/zapo` is a TypeScript connector for building WhatsApp bots on top of [zapo-js](https://www.npmjs.com/package/zapo-js). It creates and manages a WhatsApp connection, forwards client events, serializes incoming and outgoing messages, loads optional plugins, and adds high-level helpers for common message types.
4
+
5
+ ### Options
6
+
7
+ The following is the default configuration used when initializing a new Zapo connection. This setup is tailored for projects using this lib, and includes options for session management, plugin loading, and handling bot-specific behavior.
8
+
9
+ ```Javascript
10
+ type SessionType = 'mongo' | 'postgres' | 'local' | 'mysql' | 'sqlite' | 'redis'
11
+
12
+ export interface ConnectionOpts {
13
+ online?: boolean,
14
+ presence?: boolean,
15
+ stealth?: string,
16
+ custom_id: string,
17
+ pairing?: {
18
+ state: boolean,
19
+ number: string,
20
+ code?: string
21
+ },
22
+ multiple?: boolean,
23
+ create_session?: {
24
+ type: SessionType,
25
+ session: string,
26
+ config?: any,
27
+ number?: string | number,
28
+ owner?: string | number
29
+ },
30
+ setting?: any,
31
+ engines: any[],
32
+ debug: boolean,
33
+ }
34
+ ```
35
+
36
+ ### Connection
37
+
38
+ Simple way to make connection
39
+
40
+ ```Javascript
41
+ import { Client, Utils, Config } from '@neoxr/zapo'
42
+
43
+ const waSocket = new Client({
44
+ plugsdir: 'plugins',
45
+ presence: true,
46
+ online: true,
47
+ pairing: {
48
+ state: true, // Set to 'false' if you want to use QR scan
49
+ number: '6285xxxxxxx', // Your bot number
50
+ code: 'NEOXRBOT' // If you want a custom pairing code, enter 8 alphanumeric characters
51
+ },
52
+ create_session: { type: 'sqlite', session: 'bot-session' },
53
+ // stealth: 'ios', // Stealth mode to avoid bot detection, device list : ios, android, web, dekstop
54
+ custom_id: 'neoxr',
55
+ engines: [store, voip], // Init store or voip
56
+ debug: false // Set to 'true' if you want to see how this module works :v
57
+ })
58
+ ```
59
+
60
+ ### Handling Events (Built-in)
61
+
62
+ There are several events that can be used are as follows :
63
+
64
+ ```Javascript
65
+ waSocket.on('connect', () => console.log)
66
+ waSocket.on('error', error => console.log(error))
67
+ waSocket.on('ready', () => console.log)
68
+ waSocket.on('stories', ctx => console.log(ctx))
69
+ waSocket.on('message', ctx => console.log(ctx))
70
+ waSocket.on('message.delete', ctx => console.log(ctx))
71
+ waSocket.on('group.add', ctx => console.log(ctx))
72
+ waSocket.on('group.remove', ctx => console.log(ctx))
73
+ waSocket.on('group.promote', ctx => console.log(ctx))
74
+ waSocket.on('group.demote', ctx => console.log(ctx))
75
+ waSocket.on('group.request', ctx => console.log(ctx))
76
+ waSocket.on('presence', ctx => console.log(ctx))
77
+ ```
78
+
79
+ ### Event Piping (Pipelining)
80
+
81
+ You can also use the default events from Zapo.
82
+
83
+ ```Javascript
84
+ waSocket.ev.on('voip_call_incoming', (update) => console.log(update))
85
+ waSocket.ev.on('voip_call_state', (update) => console.log(update))
86
+ waSocket.ev.on('voip_call_ended', (update) => console.log(update))
87
+ waSocket.ev.on('voip_call_error', (update) => console.log(update))
88
+ waSocket.ev.on('voip_call_outbound_audio_finished', (update) => console.log(update))
89
+ waSocket.ev.on('voip_call_inbound_video', (update) => console.log(update))
90
+ waSocket.ev.on('voip_call_inbound_video_rtp', (update) => console.log(update))
91
+ waSocket.ev.on('message', (update) => console.log(update))
92
+ waSocket.ev.on('message_send', (update) => console.log(update))
93
+ waSocket.ev.on('message_addon', (update) => console.log(update))
94
+ waSocket.ev.on('message_protocol', (update) => console.log(update))
95
+ waSocket.ev.on('message_bot_chunk', (update) => console.log(update))
96
+ waSocket.ev.on('message_unavailable', (update) => console.log(update))
97
+ waSocket.ev.on('receipt', (update) => console.log(update))
98
+ waSocket.ev.on('presence', (update) => console.log(update))
99
+ waSocket.ev.on('chatstate', (update) => console.log(update))
100
+ waSocket.ev.on('call', (update) => console.log(update))
101
+ waSocket.ev.on('group', (update) => console.log(update))
102
+ waSocket.ev.on('newsletter', (update) => console.log(update))
103
+ waSocket.ev.on('newsletter_message_update', (update) => console.log(update))
104
+ waSocket.ev.on('business', (update) => console.log(update))
105
+ waSocket.ev.on('picture', (update) => console.log(update))
106
+ waSocket.ev.on('privacy', (update) => console.log(update))
107
+ waSocket.ev.on('blocklist', (update) => console.log(update))
108
+ waSocket.ev.on('own_username', (update) => console.log(update))
109
+ waSocket.ev.on('mutation', (update) => console.log(update))
110
+ waSocket.ev.on('mutation_send', (update) => console.log(update))
111
+ waSocket.ev.on('history_sync_chunk', (update) => console.log(update))
112
+ waSocket.ev.on('group_history_bundle', (update) => console.log(update))
113
+ waSocket.ev.on('offline_resume', (update) => console.log(update))
114
+ waSocket.ev.on('offline_thread_metadata', (update) => console.log(update))
115
+ waSocket.ev.on('mex_notification', (update) => console.log(update))
116
+ waSocket.ev.on('stream_failure', (update) => console.log(update))
117
+ waSocket.ev.on('stanza_error', (update) => console.log(update))
118
+ ```
119
+
120
+ ### Message Metadata
121
+
122
+ ```Javascript
123
+ {
124
+ rawNode: {
125
+ tag: 'message',
126
+ attrs: {
127
+ from: '120363418787692501@g.us',
128
+ type: 'text',
129
+ id: 'A512151D2087CBD787C23C1129D69EE5',
130
+ participant: '8792385306797@lid',
131
+ sts: '1790580592042831',
132
+ offline: '0',
133
+ verified_level: 'high',
134
+ notify: 'Neoxr Creative',
135
+ addressing_mode: 'lid',
136
+ expiration: '86400',
137
+ verified_name: '4892374714914454331',
138
+ participant_pn: '6285887776722@s.whatsapp.net',
139
+ t: '1790580591'
140
+ },
141
+ content: [
142
+ [Object],
143
+ [Object],
144
+ [Object],
145
+ [Object]
146
+ ]
147
+ },
148
+ key: {
149
+ remoteJid: '120363418787692501@g.us',
150
+ id: 'A512151D2087CBD787C23C1129D69EE5',
151
+ fromMe: false,
152
+ isGroup: true,
153
+ isBroadcast: false,
154
+ isNewsletter: false,
155
+ participantAlt: '6285887776722@s.whatsapp.net',
156
+ senderDevice: 0,
157
+ participant: '8792385306797@lid'
158
+ },
159
+ stanzaType: 'text',
160
+ offline: true,
161
+ timestampSeconds: 1790580591,
162
+ expirationSeconds: 86400,
163
+ pushName: 'Neoxr Creative',
164
+ message: e {
165
+ extendedTextMessage: e {
166
+ endCardTiles: [],
167
+ text: '=> m',
168
+ previewType: 0,
169
+ contextInfo: [e],
170
+ inviteLinkGroupTypeV2: 0
171
+ },
172
+ messageContextInfo: e {
173
+ threadId: [],
174
+ messageSecret: [Uint8Array],
175
+ botMetadata: [e]
176
+ }
177
+ },
178
+ id: 'A512151D2087CBD787C23C1129D69EE5',
179
+ isBot: false,
180
+ fromMe: false,
181
+ chat: '120363418787692501@g.us',
182
+ sender: '6285887776722@s.whatsapp.net',
183
+ isGroup: true,
184
+ mtype: 'extendedTextMessage',
185
+ quoted: null,
186
+ mentionedJid: [],
187
+ expiration: 86400,
188
+ text: '=> m',
189
+ reply: [Function(anonymous)],
190
+ react: [AsyncFunction(anonymous)],
191
+ download: [AsyncFunction(anonymous)]
192
+ }
193
+ ```
194
+ ### Messaging Function
195
+
196
+ ```Javascript
197
+ // declaration variable sock
198
+ const client = waSocket.sock
199
+
200
+ // send a text message (auto tagged)
201
+ client.reply(m.chat, `Test!`, m)
202
+
203
+ // send a react message
204
+ client.sendReact(m.chat, `๐Ÿ’€`, m.key)
205
+
206
+ // send a ptv message from path, url, or buffer (video duration 10s)
207
+ client.sendPtv(m.chat, `./media/video/yemete.mp4`)
208
+
209
+ // send a text message with custom thumbnail
210
+ client.sendMessageModify(m.chat, `Test!`, m, {
211
+ title: 'ยฉ neoxr-bot',
212
+ largeThumb: true,
213
+ ads: false,
214
+ /* can buffer or url */
215
+ thumbnail: 'https://iili.io/HP3ODj2.jpg',
216
+ url: 'https://chat.whatsapp.com/HYknAquOTrECm9KPJJQO1V'
217
+ })
218
+
219
+ // send a text message with custom thumbnail (preview link)
220
+ client.sendMessageModify(m.chat, `Test!`, m, {
221
+ title: 'ยฉ neoxr-bot',
222
+ largeThumb: true,
223
+ type: 'preview-link',
224
+ /* choose: landscape (default), portrait, square */
225
+ ratio: 'landscape',
226
+ /* can buffer or url */
227
+ thumbnail: 'https://iili.io/HP3ODj2.jpg',
228
+ url: 'https://chat.whatsapp.com/HYknAquOTrECm9KPJJQO1V'
229
+ })
230
+
231
+ // send a file from path, url, or buffer (auto extension)
232
+ client.sendFile(m.chat, 'https://iili.io/HP3ODj2.jpg', 'image.jpg', 'Test!', m)
233
+
234
+ // send a document from path, url, or buffer (auto extension)
235
+ client.sendFile(m.chat, 'https://iili.io/HP3ODj2.jpg', 'image.jpg', 'Test!', m, {
236
+ document: true
237
+ })
238
+
239
+ // send a photo live from path, url, or buffer (video)
240
+ client.sendFile(m.chat, 'https://cdn.videy.co/7QUk0zRO1.mp4', 'video.mp4', 'Test!', m, {
241
+ photo_live: true,
242
+ // thumbnail: Buffer | URL | Path
243
+ })
244
+
245
+ // send a voicenote from path, url, or buffer
246
+ client.sendFile(m.chat, './media/audio/ah.mp3', '', '', m, {
247
+ ptt: true
248
+ })
249
+
250
+ // send a audio from path, url, or buffer with thumbnail in audio tag
251
+ client.sendFile(m.chat, './media/audio/ah.mp3', '', '', m, {
252
+ audio_tag: {
253
+ APIC: < Buffer >
254
+ }
255
+ })
256
+
257
+ // send a sticker message from url or buffer
258
+ client.sendSticker(m.chat, 'https://iili.io/HP3ODj2.jpg', m, {
259
+ packname: 'Sticker by',
260
+ author: 'ยฉ neoxr.js'
261
+ })
262
+
263
+ // send an AI sticker message from url or buffer
264
+ client.sendSticker(m.chat, 'https://iili.io/HP3ODj2.jpg', m, {
265
+ packname: 'Sticker by',
266
+ author: 'ยฉ neoxr.js',
267
+ meta: true
268
+ })
269
+
270
+ // send a lock sticker from url or buffer
271
+ client.sendSticker(m.chat, 'https://iili.io/HP3ODj2.jpg', m, {
272
+ packname: 'Sticker by',
273
+ author: 'ยฉ neoxr.js',
274
+ lock: true
275
+ })
276
+
277
+ // send a premium sticker message from url or buffer
278
+ client.sendSticker(m.chat, 'https://iili.io/HP3ODj2.jpg', m, {
279
+ packname: 'Sticker by',
280
+ author: 'ยฉ neoxr.js',
281
+ premium: true
282
+ })
283
+
284
+ // send poll result
285
+ client.pollResult(m.chat, {
286
+ name: 'Demo Poll Result',
287
+ votes: [{
288
+ name: 'Jokowi',
289
+ count: 1500
290
+ }, {
291
+ name: 'Prabowo',
292
+ count: 200
293
+ }]
294
+ }, m)
295
+
296
+ // send contact message
297
+ client.sendContact(m.chat, [{
298
+ name: 'Wildan Izzudin',
299
+ number: '6285887776722',
300
+ about: 'Owner & Creator'
301
+ }], m, {
302
+ org: 'Neoxr Network',
303
+ website: 'https://api.neoxr.my.id',
304
+ email: 'contact@neoxr.my.id'
305
+ })
306
+
307
+ // send interactive button message (your own risk)
308
+ var buttons = [{
309
+ name: "quick_reply",
310
+ buttonParamsJson: JSON.stringify({
311
+ display_text: "OWNER",
312
+ id: '.owner'
313
+ }),
314
+ }, {
315
+ name: "cta_url",
316
+ buttonParamsJson: JSON.stringify({
317
+ display_text: "Rest API",
318
+ url: "https://api.neoxr.my.id",
319
+ merchant_url: "https://api.neoxr.my.id"
320
+ })
321
+ }, {
322
+ name: "cta_copy",
323
+ buttonParamsJson: JSON.stringify({
324
+ display_text: "Copy",
325
+ copy_code: "123456"
326
+ })
327
+ }, {
328
+ name: "cta_call",
329
+ buttonParamsJson: JSON.stringify({
330
+ display_text: "Call",
331
+ phone_number: "6285887776722"
332
+ })
333
+ }, {
334
+ name: "single_select",
335
+ buttonParamsJson: JSON.stringify({
336
+ title: "Tap!",
337
+ sections: [{
338
+ rows: [{
339
+ title: "Owner",
340
+ description: `X`,
341
+ id: `.owner`
342
+ }, {
343
+ title: "Runtime",
344
+ description: `Y`,
345
+ id: `.run`
346
+ }]
347
+ }]
348
+ })
349
+ }]
350
+
351
+ // button & list
352
+ client.replyButton(m.chat, buttons, m, {
353
+ header: '',
354
+ content: 'Hi!',
355
+ // v2: true, (for product style with image)
356
+ type: 'interactive',
357
+ footer: '',
358
+ media: global.db.setting.cover // video or image link
359
+ })
360
+
361
+ // button & list (multiple)
362
+ client.replyButton(m.chat, buttons, m, {
363
+ header: '',
364
+ content: 'Hi!',
365
+ // v2: true, (for product style with image)
366
+ footer: '',
367
+ media: global.db.setting.cover, // video or image link
368
+ multiple: {
369
+ name: 'ใ‚ชใƒผใƒˆใƒกใƒผใ‚ทใƒงใƒณ',
370
+ code: 'neoxr-bot',
371
+ list_title: 'Select Menu',
372
+ button_title: 'Tap Here!'
373
+ },
374
+ type: 'interactive'
375
+ })
376
+
377
+ // carousel message
378
+ const cards = [{
379
+ header: {
380
+ image: global.db.setting.cover,
381
+ hasMediaAttachment: true,
382
+ },
383
+ body: {
384
+ text: "P"
385
+ },
386
+ nativeFlowMessage: {
387
+ buttons: [{
388
+ name: "cta_url",
389
+ buttonParamsJson: JSON.stringify({
390
+ display_text: 'Contact Owner',
391
+ url: 'https://api.neoxr.eu',
392
+ webview_presentation: null
393
+ })
394
+ }]
395
+ }
396
+ }, {
397
+ header: {
398
+ image: global.db.setting.cover,
399
+ hasMediaAttachment: true,
400
+ },
401
+ body: {
402
+ text: "P"
403
+ },
404
+ nativeFlowMessage: {
405
+ buttons: [{
406
+ name: "cta_url",
407
+ buttonParamsJson: JSON.stringify({
408
+ display_text: 'Contact Owner',
409
+ url: 'https://api.neoxr.eu',
410
+ webview_presentation: null
411
+ })
412
+ }]
413
+ }
414
+ }]
415
+
416
+ client.replyButton(m.chat, [], m, {
417
+ title: global.header,
418
+ type: 'interactive',
419
+ content: 'Hi! @0',
420
+ cards
421
+ })
422
+
423
+ // send old button all type
424
+ var buttons = [{
425
+ text: 'Runtime',
426
+ command: '.runtime'
427
+ }, {
428
+ text: 'Statistic',
429
+ command: '.stat'
430
+ }]
431
+
432
+ // button text
433
+ client.replyButton(m.chat, buttons, m, {
434
+ text: 'Hi @0',
435
+ footer: global.footer // do not empty
436
+ })
437
+
438
+ // button image & video
439
+ client.replyButton(m.chat, buttons, m, {
440
+ text: 'Hi @0', // do not empty
441
+ footer: global.footer, // do not empty
442
+ media: global.db.setting.cover // video or image link
443
+ })
444
+
445
+ // button document
446
+ client.replyButton(m.chat, buttons, m, {
447
+ text: 'Hi @0', // do not empty
448
+ footer: global.footer, // do not empty
449
+ media: global.db.setting.cover, // file link (all extension)
450
+ document: {
451
+ filename: 'neoxr.jpg'
452
+ }
453
+ })
454
+
455
+ // button location
456
+ client.replyButton(m.chat, buttons, m, {
457
+ text: 'Hi @0', // do not empty
458
+ footer: global.footer, // do not empty
459
+ media: global.db.setting.cover, // file link (all extension)
460
+ location: {
461
+ name: global.header,
462
+ description: 'ใ‚ชใƒผใƒˆใƒกใƒผใ‚ทใƒงใƒณ'
463
+ }
464
+ })
465
+
466
+ // old button + native flow
467
+ client.replyButton(m.chat, [{
468
+ text: 'Runtime',
469
+ command: '.runtime'
470
+ }, {
471
+ name: 'single_select',
472
+ params: {
473
+ title: 'Tap!',
474
+ sections: [{
475
+ rows: [{
476
+ title: 'Runtime',
477
+ description: '---',
478
+ id: '.runtime'
479
+ }, {
480
+ title: 'Statistic',
481
+ description: '---',
482
+ id: '.stat'
483
+ }]
484
+ }]
485
+ }
486
+ }], m, {
487
+ text: 'Hi @0', // do not empty
488
+ footer: global.footer, // do not empty
489
+ media: global.db.setting.cover // video or image link
490
+ })
491
+
492
+ // send album message
493
+ client.sendAlbumMessage(m.chat, [{
494
+ url: 'https://i.pinimg.com/736x/6f/a3/6a/6fa36aa2c367da06b2a4c8ae1cf9ee02.jpg',
495
+ caption: 'Content 1st', // optional
496
+ type: 'image' // optional
497
+ }, {
498
+ url: 'https://i.pinimg.com/736x/0b/97/6f/0b976f0a7aa1aa43870e1812eee5a55d.jpg',
499
+ caption: 'Content 2nd', // optional
500
+ type: 'image' // optional
501
+ }, {
502
+ url: 'https://i.pinimg.com/736x/8c/6d/db/8c6ddb5fe6600fcc4b183cb2ee228eb7.jpg',
503
+ caption: 'Content 2nd', // optional
504
+ type: 'image' // optional
505
+ }], m)
506
+
507
+ // send group status (video & image)
508
+ client.groupStatus(m.chat, {
509
+ media: 'https://i.pinimg.com/736x/0b/97/6f/0b976f0a7aa1aa43870e1812eee5a55d.jpg', // Support URL and Buffer
510
+ caption: 'Hi!'
511
+ })
512
+
513
+ // send group status (audio)
514
+ client.groupStatus(m.chat, {
515
+ media: 'https://example.com/audio.mp3', // Support URL and Buffer
516
+ background: '#FF0000'
517
+ })
518
+
519
+ // send group status (text)
520
+ client.groupStatus(m.chat, {
521
+ text: 'Hi!',
522
+ background: '#FF0000',
523
+ color: '#222222'
524
+ })
525
+
526
+ // send group status (close friends)
527
+ // same like group status just add private options
528
+ client.groupStatus(m.chat, {
529
+ text: 'Hi!',
530
+ background: '#FF0000',
531
+ color: '#222222'
532
+ }, {
533
+ private: {
534
+ name: 'Neoxr Creative',
535
+ emoji: '๐Ÿ”ฅ'
536
+ }
537
+ })
538
+
539
+ // send group status (instant)
540
+ client.groupStatus(m.chat, m.quoted.fakeObj, {
541
+ private: {
542
+ name: 'Neoxr Creative',
543
+ emoji: '๐Ÿ”ฅ'
544
+ }
545
+ })
546
+
547
+ // send meta message v1 (rich message)
548
+ client.sendMetaMsg(m.chat, [{
549
+ text: `Hi @${m.sender.replace(/@.+/, '')} โœจ, This is an example of a simple meta message that supports *mentions*, *tables* and *code format*.\n\nAnd below is an example of the code format.`
550
+ },
551
+ {
552
+ code: {
553
+ language: 'javascript',
554
+ code: fs.readFileSync('./error.js', 'utf-8')
555
+ }
556
+ },
557
+ {
558
+ text: `And this is an example of a table.`
559
+ },
560
+ {
561
+ table: {
562
+ title: 'Data',
563
+ headers: ['Code', 'Artist'],
564
+ rows: [
565
+ ['SSID-738', 'Yua Mikami'],
566
+ ['RTXU-849', `@${m.sender.replace(/@.+/, '')}`]
567
+ ]
568
+ }
569
+ }, {
570
+ text: 'You can add text, tables, and code formats as you like. ๐Ÿ˜Ž'
571
+ },], m, {
572
+ title: global.header,
573
+ mentions: [m.sender]
574
+ })
575
+
576
+ // send meta message v2 (rich message)
577
+ client.sendMetaMsg(m.chat, [
578
+ {
579
+ text: `This is an example of a meta message that does not support *~mentions~* and *~tables~*, but has many variations. Such as citations [](https://api.neoxr.eu) and links [Neoxr API](https://api.neoxr.eu).\n\nCode formatting can still works :`
580
+ },
581
+ {
582
+ code: {
583
+ language: 'javascript',
584
+ code: fs.readFileSync('./error.js', 'utf-8')
585
+ }
586
+ },
587
+ {
588
+ muted: 'There is also muted text like this.'
589
+ },
590
+ {
591
+ suggestions: ['N', 'E', 'O', 'X', 'R', 'B', 'O', 'T']
592
+ },
593
+ {
594
+ sources: [{
595
+ icon: 'https://i.pinimg.com/736x/b4/e0/12/b4e012b9e55bc101eb2c89655888e2f1.jpg',
596
+ title: 'Github',
597
+ url: 'https://github.com/neoxr/neoxr-bot'
598
+ }]
599
+ }], m, {
600
+ title: global.header
601
+ })
602
+
603
+ // send meta message v3 (rich message)
604
+ client.sendMetaMsg(m.chat, [
605
+ {
606
+ text: 'Photo and video media messages are supported, however, they do not support *~mentions~* and *~tables~*.\n\n---\n\nHere is an example of a reel:'
607
+ },
608
+ {
609
+ reels: [
610
+ 'https://i.pinimg.com/736x/48/58/17/485817189f76066e8b22637d1310d3b4.jpg',
611
+ 'https://i.pinimg.com/736x/0e/32/e3/0e32e35b0324a541ba7fe705330febde.jpg',
612
+ 'https://i.pinimg.com/736x/88/78/b1/8878b18952e3587dd5c7502f35155731.jpg'
613
+ ].map(image => ({
614
+ creator: 'Neoxr Creative',
615
+ avatar: 'https://avatars.githubusercontent.com/u/52621597?v=4',
616
+ verified: true,
617
+ thumbnail: image,
618
+ url: 'https://api.neoxr.eu',
619
+ source: 'IG'
620
+ }))
621
+ },
622
+ {
623
+ text: '\n\n---\n\nHere is an example of a social media post:'
624
+ },
625
+ {
626
+ posts: [{
627
+ media: 'https://i.pinimg.com/736x/ba/fd/92/bafd92cf5c8fbd802cf59c51286fc13f.jpg',
628
+ caption: 'ํ•˜๋Š˜์ด ๋ฌด๋„ˆ์ ธ๋„ ์†Ÿ์•„๋‚  ๊ตฌ๋ฉ์€ ์žˆ๋‹ค๋Š”๋ฐ, ๋‚œ ๊ทธ๋ƒฅ ๊ทธ ๊ตฌ๋ฉ์œผ๋กœ ๋“ค์–ด๊ฐ€์„œ ๋‚ฎ์ž  ์ž˜๋ž˜.',
629
+ source: 'FACEBOOK'
630
+ }, {
631
+ media: 'https://i.pinimg.com/1200x/ec/0a/fd/ec0afd363645fa73d9d17df1136fddd4.jpg',
632
+ caption: '๋ƒ‰์žฅ๊ณ ๋ž‘ ์ง„์ง€ํ•˜๊ฒŒ ๋Œ€ํ™”ํ–ˆ๋‹ค. ๊ฑ”๋Š” ์ž๊พธ ๋ถˆ๋น›์„ ๊นœ๋นก์ด๋ฉฐ ๋‚˜ํ•œํ…Œ ์šฐ์ฃผ์  ์‹ ํ˜ธ๋ฅผ ๋ณด๋‚ด๋Š” ๊ฒƒ ๊ฐ™์•„.',
633
+ source: 'THREADS'
634
+ }, {
635
+ media: 'https://i.pinimg.com/736x/53/dd/f9/53ddf9fcf881b704548f2b6c676b07a6.jpg',
636
+ caption: '์–ด์ œ ๋จน์€ ๋–ก๋ณถ์ด๊ฐ€ ์‚ฌ์‹ค ๋‚ด ์ „์ƒ์ผ์ง€๋„ ๋ชฐ๋ผ. ์ซ„๊นƒํ•œ ์ธ์ƒ.',
637
+ source: 'INSTAGRAM'
638
+ }].map(v => ({
639
+ username: 'Neoxr Creative',
640
+ avatar: 'https://avatars.githubusercontent.com/u/52621597?v=4',
641
+ verified: true,
642
+ caption: v.caption,
643
+ url: 'https://api.neoxr.eu',
644
+ thumbnail: v.media,
645
+ source: v.source,
646
+ post_type: 'PHOTO'
647
+ }))
648
+ },
649
+ {
650
+ text: '\n\n---\n\nHere is an example of a non-slide product:\n\n'
651
+ },
652
+ {
653
+ products: {
654
+ title: 'Script Selfbot (WhatsApp Bot) [Free Update]',
655
+ image: 'https://imgkub.com/images/2026/01/14/image586735a7ca2a894a.jpg',
656
+ sale_price: 'Rp. 65.000',
657
+ brand: 'Neoxr Creative',
658
+ url: `https://wa.me/${Config.owner}`
659
+ }
660
+ },
661
+ {
662
+ text: '\n'
663
+ },
664
+ {
665
+ products: {
666
+ title: 'Payment Gateway',
667
+ image: 'https://imgkub.com/images/2026/01/22/image7af565014aadeae6.jpg',
668
+ sale_price: 'Rp. 80.000',
669
+ brand: 'Neoxr Creative',
670
+ url: `https://wa.me/${Config.owner}`
671
+ }
672
+ },
673
+ {
674
+ text: '\n\n---\n\nHere is an example of a slide product:'
675
+ },
676
+ {
677
+ products: [{
678
+ title: 'Script Premium (WhatsApp Bot) V5.1-Optima',
679
+ image: 'https://imgkub.com/images/2025/12/07/image6e1f9b94ba9ced64.jpg',
680
+ sale_price: 'Rp. 150.000'
681
+ }, {
682
+ title: 'Script E-Commerce (NeoCommerce)',
683
+ image: 'https://imgkub.com/images/2025/12/07/image42981ad8a7441ff7.jpg',
684
+ price: 'Rp. 175.000',
685
+ sale_price: 'Rp. 150.000'
686
+ }, {
687
+ title: 'Script Selfbot (WhatsApp Bot)',
688
+ image: 'https://imgkub.com/images/2026/01/14/image3b73a38fbc0a64c6.jpg',
689
+ sale_price: 'Rp. 55.000'
690
+ }, {
691
+ title: 'Temporary Uploader & URL Shortener',
692
+ image: 'https://imgkub.com/images/2025/12/13/imagef7b7c40836e6b3d2.jpg',
693
+ sale_price: 'Rp. 60.000'
694
+ }].map(v => ({
695
+ ...v,
696
+ brand: 'Neoxr Creative',
697
+ url: `https://wa.me/${Config.owner}`
698
+ }))
699
+ }], m, {
700
+ title: global.header
701
+ })
702
+ ```
703
+
704
+ ### Exclusive Message
705
+
706
+ This feature can be enabled simply by adding the `{ exclusive: true }` parameter. It allows messages to be sent within a group, but the message can only be seen by the sender. Other members of the group cannot see it.
707
+
708
+
709
+ ```Javascript
710
+ client.reply(m.chat, 'Hi, this message can only be seen by you.', m, { exclusive: true })
711
+ ```
712
+
713
+ The `m` (quoted message) parameter is required and must always be provided when using this feature.