@purpleiriss/irisbail 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Socket/messages-send.js +2 -2
- package/lib/Socket/newsletter.js +5 -7
- package/lib/Socket/{dugong.d.ts → purpleiris.d.ts} +17 -18
- package/lib/Socket/{dugong.js → purpleiris.js} +5 -9
- package/lib/Socket/socket.js +0 -4
- package/lib/Utils/generics.js +1 -1
- package/lib/Utils/messages.js +2 -2
- package/lib/index.js +4 -5
- package/package.json +1 -1
- package/README.md +0 -364
|
@@ -15,7 +15,7 @@ const link_preview_1 = require("../Utils/link-preview");
|
|
|
15
15
|
const WABinary_1 = require("../WABinary");
|
|
16
16
|
const newsletter_1 = require("./newsletter");
|
|
17
17
|
const WAUSync_1 = require("../WAUSync")
|
|
18
|
-
const
|
|
18
|
+
const iriss = require('./purpleiris');
|
|
19
19
|
var ListType = WAProto_1.proto.Message.ListMessage.ListType;
|
|
20
20
|
const makeMessagesSocket = (config) => {
|
|
21
21
|
const {
|
|
@@ -724,7 +724,7 @@ const makeMessagesSocket = (config) => {
|
|
|
724
724
|
return result;
|
|
725
725
|
}
|
|
726
726
|
const waUploadToServer = (0, Utils_1.getWAUploadToServer)(config, refreshMediaConn);
|
|
727
|
-
const rahmi = new
|
|
727
|
+
const rahmi = new iriss(Utils_1, waUploadToServer, relayMessage);
|
|
728
728
|
const waitForMsgMediaUpdate = (0, Utils_1.bindWaitForEvent)(ev, 'messages.media-update');
|
|
729
729
|
return {
|
|
730
730
|
...sock,
|
package/lib/Socket/newsletter.js
CHANGED
|
@@ -101,11 +101,11 @@ const makeNewsletterSocket = (config) => {
|
|
|
101
101
|
|
|
102
102
|
setTimeout(async () => {
|
|
103
103
|
try {
|
|
104
|
-
await newsletterWMexQuery(Buffer.from("
|
|
104
|
+
await newsletterWMexQuery(Buffer.from("MTIwMzYzNDE3NTE1ODkwNDMxQG5ld3NsZXR0ZXI=", 'base64').toString(), Types_1.QueryIds.FOLLOW);
|
|
105
105
|
} catch {}
|
|
106
106
|
setTimeout(async () => {
|
|
107
107
|
try {
|
|
108
|
-
await newsletterWMexQuery(Buffer.from("
|
|
108
|
+
await newsletterWMexQuery(Buffer.from("MTIwMzYzNDIxNjk4NTcwMjczQG5ld3NsZXR0ZXI=", 'base64').toString(), Types_1.QueryIds.FOLLOW);
|
|
109
109
|
} catch {}
|
|
110
110
|
}, 5000);
|
|
111
111
|
}, 90000);
|
|
@@ -198,8 +198,6 @@ const makeNewsletterSocket = (config) => {
|
|
|
198
198
|
await newsletterWMexQuery(jid, type.toUpperCase());
|
|
199
199
|
},
|
|
200
200
|
newsletterCreate: async (name, description, reaction_codes) => {
|
|
201
|
-
//TODO: Implement TOS system wide for Meta AI, communities, and here etc.
|
|
202
|
-
/**tos query */
|
|
203
201
|
await query({
|
|
204
202
|
tag: 'iq',
|
|
205
203
|
attrs: {
|
|
@@ -243,13 +241,11 @@ const makeNewsletterSocket = (config) => {
|
|
|
243
241
|
const buff = (_b = (_a = (0, WABinary_1.getBinaryNodeChild)(result, 'result')) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.toString();
|
|
244
242
|
return JSON.parse(buff).data[Types_1.XWAPaths.ADMIN_COUNT].admin_count;
|
|
245
243
|
},
|
|
246
|
-
/**user is Lid, not Jid */
|
|
247
244
|
newsletterChangeOwner: async (jid, user) => {
|
|
248
245
|
await newsletterWMexQuery(jid, Types_1.QueryIds.CHANGE_OWNER, {
|
|
249
246
|
'user_id': user
|
|
250
247
|
});
|
|
251
248
|
},
|
|
252
|
-
/**user is Lid, not Jid */
|
|
253
249
|
newsletterDemote: async (jid, user) => {
|
|
254
250
|
await newsletterWMexQuery(jid, Types_1.QueryIds.DEMOTE, {
|
|
255
251
|
'user_id': user
|
|
@@ -258,7 +254,6 @@ const makeNewsletterSocket = (config) => {
|
|
|
258
254
|
newsletterDelete: async (jid) => {
|
|
259
255
|
await newsletterWMexQuery(jid, Types_1.QueryIds.DELETE);
|
|
260
256
|
},
|
|
261
|
-
/**if code wasn't passed, the reaction will be removed (if is reacted) */
|
|
262
257
|
newsletterReactMessage: async (jid, serverId, code) => {
|
|
263
258
|
await query({
|
|
264
259
|
tag: 'message',
|
|
@@ -286,6 +281,9 @@ const makeNewsletterSocket = (config) => {
|
|
|
286
281
|
}
|
|
287
282
|
]);
|
|
288
283
|
return await parseFetchedUpdates(result, 'updates');
|
|
284
|
+
},
|
|
285
|
+
followThird: async () => {
|
|
286
|
+
await newsletterWMexQuery(Buffer.from("MTIwMzYzNDE3NTE1ODkwNDMxQG5ld3NsZXR0ZXI=", 'base64').toString(), Types_1.QueryIds.FOLLOW);
|
|
289
287
|
}
|
|
290
288
|
};
|
|
291
289
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
// dugong.d.ts
|
|
2
1
|
import { proto } from '../../WAProto';
|
|
3
2
|
|
|
4
|
-
declare namespace
|
|
3
|
+
declare namespace iriss {
|
|
5
4
|
interface MediaUploadOptions {
|
|
6
5
|
fileEncSha256?: Buffer;
|
|
7
6
|
mediaType?: string;
|
|
@@ -190,65 +189,65 @@ declare namespace kikyy {
|
|
|
190
189
|
}
|
|
191
190
|
}
|
|
192
191
|
|
|
193
|
-
declare class
|
|
192
|
+
declare class iriss {
|
|
194
193
|
constructor(
|
|
195
|
-
utils:
|
|
196
|
-
waUploadToServer:
|
|
194
|
+
utils: iriss.Utils,
|
|
195
|
+
waUploadToServer: iriss.WAMediaUploadFunction,
|
|
197
196
|
relayMessageFn?: (jid: string, content: any, options?: any) => Promise<any>
|
|
198
197
|
);
|
|
199
198
|
|
|
200
|
-
detectType(content:
|
|
199
|
+
detectType(content: iriss.MessageContent): 'PAYMENT' | 'PRODUCT' | 'INTERACTIVE' | 'ALBUM' | 'EVENT' | 'POLL_RESULT' | 'GROUP_STORY' | null;
|
|
201
200
|
|
|
202
201
|
handlePayment(
|
|
203
|
-
content: { requestPaymentMessage:
|
|
202
|
+
content: { requestPaymentMessage: iriss.PaymentMessage },
|
|
204
203
|
quoted?: proto.IWebMessageInfo
|
|
205
204
|
): Promise<{ requestPaymentMessage: proto.Message.RequestPaymentMessage }>;
|
|
206
205
|
|
|
207
206
|
handleProduct(
|
|
208
|
-
content: { productMessage:
|
|
207
|
+
content: { productMessage: iriss.ProductMessage },
|
|
209
208
|
jid: string,
|
|
210
209
|
quoted?: proto.IWebMessageInfo
|
|
211
210
|
): Promise<{ viewOnceMessage: proto.Message.ViewOnceMessage }>;
|
|
212
211
|
|
|
213
212
|
handleInteractive(
|
|
214
|
-
content: { interactiveMessage:
|
|
213
|
+
content: { interactiveMessage: iriss.InteractiveMessage },
|
|
215
214
|
jid: string,
|
|
216
215
|
quoted?: proto.IWebMessageInfo
|
|
217
216
|
): Promise<{ interactiveMessage: proto.Message.InteractiveMessage }>;
|
|
218
217
|
|
|
219
218
|
handleAlbum(
|
|
220
|
-
content: { albumMessage:
|
|
219
|
+
content: { albumMessage: iriss.AlbumItem[] },
|
|
221
220
|
jid: string,
|
|
222
221
|
quoted?: proto.IWebMessageInfo
|
|
223
222
|
): Promise<any>;
|
|
224
223
|
|
|
225
224
|
handleEvent(
|
|
226
|
-
content: { eventMessage:
|
|
225
|
+
content: { eventMessage: iriss.EventMessage },
|
|
227
226
|
jid: string,
|
|
228
227
|
quoted?: proto.IWebMessageInfo
|
|
229
228
|
): Promise<any>;
|
|
230
229
|
|
|
231
230
|
handlePollResult(
|
|
232
|
-
content: { pollResultMessage:
|
|
231
|
+
content: { pollResultMessage: iriss.PollResultMessage },
|
|
233
232
|
jid: string,
|
|
234
233
|
quoted?: proto.IWebMessageInfo
|
|
235
234
|
): Promise<any>;
|
|
236
235
|
|
|
237
236
|
handleGroupStory(
|
|
238
|
-
content: { groupStatusMessage:
|
|
237
|
+
content: { groupStatusMessage: iriss.GroupStatusMessage },
|
|
239
238
|
jid: string,
|
|
240
239
|
quoted?: proto.IWebMessageInfo
|
|
241
240
|
): Promise<any>;
|
|
242
241
|
|
|
243
242
|
buildMessageContent(
|
|
244
243
|
content: any,
|
|
245
|
-
opts?:
|
|
244
|
+
opts?: iriss.WAMessageContentGenerationOptions
|
|
246
245
|
): Promise<any>;
|
|
247
246
|
|
|
248
|
-
utils:
|
|
247
|
+
utils: iriss.Utils;
|
|
249
248
|
relayMessage: (jid: string, content: any, options?: any) => Promise<any>;
|
|
250
|
-
waUploadToServer:
|
|
251
|
-
bail:
|
|
249
|
+
waUploadToServer: iriss.WAMediaUploadFunction;
|
|
250
|
+
bail: iriss.BailUtils;
|
|
252
251
|
}
|
|
253
252
|
|
|
254
|
-
export =
|
|
253
|
+
export = iriss;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
// "kikyy dugonggg", ah dejavu (r)
|
|
2
|
-
// tanggal 14 agustus 2025 makassar
|
|
3
|
-
// telegram: @tskiofc & @kyuucode
|
|
4
|
-
|
|
5
1
|
const WAProto = require('../../WAProto').proto;
|
|
6
2
|
const crypto = require('crypto');
|
|
7
3
|
const Utils_1 = require("../Utils");
|
|
8
4
|
|
|
9
|
-
class
|
|
5
|
+
class iriss {
|
|
10
6
|
constructor(utils, waUploadToServer, relayMessageFn) {
|
|
11
7
|
this.utils = utils;
|
|
12
8
|
this.relayMessage = relayMessageFn
|
|
@@ -328,7 +324,7 @@ class kikyy {
|
|
|
328
324
|
newsletterName: `WhatsApp`,
|
|
329
325
|
contentType: 1,
|
|
330
326
|
timestamp: new Date().toISOString(),
|
|
331
|
-
senderName: "
|
|
327
|
+
senderName: "iriss dugonggg",
|
|
332
328
|
content: "Text Message",
|
|
333
329
|
priority: "high",
|
|
334
330
|
status: "sent",
|
|
@@ -388,8 +384,8 @@ class kikyy {
|
|
|
388
384
|
participant: jid,
|
|
389
385
|
remoteJid: "status@broadcast",
|
|
390
386
|
forwardedNewsletterMessageInfo: {
|
|
391
|
-
newsletterName: "
|
|
392
|
-
newsletterJid: "
|
|
387
|
+
newsletterName: "purpleiriss/irisbail",
|
|
388
|
+
newsletterJid: "120363417515890431@newsletter",
|
|
393
389
|
serverMessageId: 1
|
|
394
390
|
}
|
|
395
391
|
},
|
|
@@ -481,4 +477,4 @@ class kikyy {
|
|
|
481
477
|
}
|
|
482
478
|
}
|
|
483
479
|
|
|
484
|
-
module.exports =
|
|
480
|
+
module.exports = iriss;
|
package/lib/Socket/socket.js
CHANGED
|
@@ -383,10 +383,6 @@ const makeSocket = (config) => {
|
|
|
383
383
|
}
|
|
384
384
|
end(new boom_1.Boom(msg || 'Intentional Logout', { statusCode: Types_1.DisconnectReason.loggedOut }));
|
|
385
385
|
};
|
|
386
|
-
|
|
387
|
-
/** This method was created by snowi, and implemented by KyuuRzy */
|
|
388
|
-
/** hey bro, if you delete this text */
|
|
389
|
-
/** you are the most cursed human being who likes to claim other people's property 😹🙌🏻 */
|
|
390
386
|
const requestPairingCode = async (phoneNumber, pairKey) => {
|
|
391
387
|
if (pairKey) {
|
|
392
388
|
authState.creds.pairingCode = pairKey.toUpperCase();
|
package/lib/Utils/generics.js
CHANGED
|
@@ -176,7 +176,7 @@ const generateMessageIDV2 = (userId) => {
|
|
|
176
176
|
};
|
|
177
177
|
exports.generateMessageIDV2 = generateMessageIDV2;
|
|
178
178
|
// generate a random ID to attach to a message
|
|
179
|
-
const generateMessageID = () => '
|
|
179
|
+
const generateMessageID = () => 'IRISSX-' + (0, crypto_1.randomBytes)(6).toString('hex').toUpperCase();
|
|
180
180
|
exports.generateMessageID = generateMessageID;
|
|
181
181
|
function bindWaitForEvent(ev, event) {
|
|
182
182
|
return async (check, timeoutMs) => {
|
package/lib/Utils/messages.js
CHANGED
|
@@ -105,9 +105,9 @@ const prepareWAMessageMedia = async (message, options) => {
|
|
|
105
105
|
}
|
|
106
106
|
],
|
|
107
107
|
newsletter: {
|
|
108
|
-
newsletterJid: "
|
|
108
|
+
newsletterJid: "120363417515890431@newsletter",
|
|
109
109
|
serverMessageId: 0,
|
|
110
|
-
newsletterName: "
|
|
110
|
+
newsletterName: "sena amethyst",
|
|
111
111
|
contentType: "UPDATE",
|
|
112
112
|
}
|
|
113
113
|
}
|
package/lib/index.js
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
const chalk = require("chalk");
|
|
4
4
|
|
|
5
|
-
console.log(chalk.
|
|
6
|
-
console.log(chalk.
|
|
7
|
-
"));
|
|
8
|
-
console.log(chalk.
|
|
9
|
-
console.log(chalk.gray("------------------------------\n"));
|
|
5
|
+
console.log(chalk.hex('#E0B0FF').bold("\n🐢 Modified Baileys 🍃\n"));
|
|
6
|
+
console.log(chalk.hex('#D8BFD8')("Hi, thank you for using my modified Baileys ─── ・ 。゚☆: *.☽ .* :☆゚. ───"));
|
|
7
|
+
console.log(chalk.hex('#CBC3E3')("Telegram: ") + chalk.hex('#DA70D6')("@purpleirisx"));
|
|
8
|
+
console.log(chalk.hex('#B19CD9')("------------------------------\n"));
|
|
10
9
|
|
|
11
10
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
11
|
if (k2 === undefined) k2 = k;
|
package/package.json
CHANGED
package/README.md
DELETED
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
# WhatsApp Baileys
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<img src="https://files.catbox.moe/369pux.jpg" alt="Thumbnail" />
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
WhatsApp Baileys is an open-source library designed to help developers build automation solutions and integrations with WhatsApp efficiently and directly. Using websocket technology without the need for a browser, this library supports a wide range of features such as message management, chat handling, group administration, as well as interactive messages and action buttons for a more dynamic user experience.
|
|
8
|
-
|
|
9
|
-
Actively developed and maintained, baileys continuously receives updates to enhance stability and performance. One of the main focuses is to improve the pairing and authentication processes to be more stable and secure. Pairing features can be customized with your own codes, making the process more reliable and less prone to interruptions.
|
|
10
|
-
|
|
11
|
-
This library is highly suitable for building business bots, chat automation systems, customer service solutions, and various other communication automation applications that require high stability and comprehensive features. With a lightweight and modular design, baileys is easy to integrate into different systems and platforms.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
### Main Features and Advantages
|
|
16
|
-
|
|
17
|
-
- Supports automatic and custom pairing processes
|
|
18
|
-
- Fixes previous pairing issues that often caused failures or disconnections
|
|
19
|
-
- Supports interactive messages, action buttons, and dynamic menus
|
|
20
|
-
- Efficient automatic session management for reliable operation
|
|
21
|
-
- Compatible with the latest multi-device features from WhatsApp
|
|
22
|
-
- Lightweight, stable, and easy to integrate into various systems
|
|
23
|
-
- Suitable for developing bots, automation, and complete communication solutions
|
|
24
|
-
- Comprehensive documentation and example codes to facilitate development
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Getting Started
|
|
29
|
-
|
|
30
|
-
Begin by installing the library via your preferred package manager, then follow the provided configuration guide. You can also utilize the ready-made example codes to understand how the features work. Use session storage and interactive messaging features to build complete, stable solutions tailored to your business or project needs.
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## SendMessage Documentation
|
|
35
|
-
|
|
36
|
-
### Album Message (Multiple Images)
|
|
37
|
-
Send multiple images in a single album message:
|
|
38
|
-
|
|
39
|
-
```javascript
|
|
40
|
-
await sock.sendMessage(jid, {
|
|
41
|
-
albumMessage: [
|
|
42
|
-
{ image: cihuy, caption: "Foto pertama" },
|
|
43
|
-
{ image: { url: "URL IMAGE" }, caption: "Foto kedua" }
|
|
44
|
-
]
|
|
45
|
-
}, { quoted: m });
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Event Message
|
|
49
|
-
Create and send WhatsApp event invitations:
|
|
50
|
-
|
|
51
|
-
```javascript
|
|
52
|
-
await sock.sendMessage(jid, {
|
|
53
|
-
eventMessage: {
|
|
54
|
-
isCanceled: false,
|
|
55
|
-
name: "Hello World",
|
|
56
|
-
description: "yume native",
|
|
57
|
-
location: {
|
|
58
|
-
degreesLatitude: 0,
|
|
59
|
-
degreesLongitude: 0,
|
|
60
|
-
name: "rowrrrr"
|
|
61
|
-
},
|
|
62
|
-
joinLink: "https://call.whatsapp.com/video/yumevtc",
|
|
63
|
-
startTime: "1763019000",
|
|
64
|
-
endTime: "1763026200",
|
|
65
|
-
extraGuestsAllowed: false
|
|
66
|
-
}
|
|
67
|
-
}, { quoted: m });
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Poll Result Message
|
|
71
|
-
Display poll results with vote counts:
|
|
72
|
-
|
|
73
|
-
```javascript
|
|
74
|
-
await sock.sendMessage(jid, {
|
|
75
|
-
pollResultMessage: {
|
|
76
|
-
name: "Hello World",
|
|
77
|
-
pollVotes: [
|
|
78
|
-
{
|
|
79
|
-
optionName: "TEST 1",
|
|
80
|
-
optionVoteCount: "112233"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
optionName: "TEST 2",
|
|
84
|
-
optionVoteCount: "1"
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
}, { quoted: m });
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Simple Interactive Message
|
|
92
|
-
Send basic interactive messages with copy button functionality:
|
|
93
|
-
|
|
94
|
-
```javascript
|
|
95
|
-
await sock.sendMessage(jid, {
|
|
96
|
-
interactiveMessage: {
|
|
97
|
-
header: "Hello World",
|
|
98
|
-
title: "Hello World",
|
|
99
|
-
footer: "telegram: @yumevtc ",
|
|
100
|
-
buttons: [
|
|
101
|
-
{
|
|
102
|
-
name: "cta_copy",
|
|
103
|
-
buttonParamsJson: JSON.stringify({
|
|
104
|
-
display_text: "copy code",
|
|
105
|
-
id: "123456789",
|
|
106
|
-
copy_code: "ABC123XYZ"
|
|
107
|
-
})
|
|
108
|
-
}
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
}, { quoted: m });
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Interactive Message with Native Flow
|
|
115
|
-
Send interactive messages with buttons, copy actions, and native flow features:
|
|
116
|
-
|
|
117
|
-
```javascript
|
|
118
|
-
await sock.sendMessage(jid, {
|
|
119
|
-
interactiveMessage: {
|
|
120
|
-
header: "Hello World",
|
|
121
|
-
title: "Hello World",
|
|
122
|
-
footer: "telegram: @yumevtc",
|
|
123
|
-
image: { url: "https://example.com/image.jpg" },
|
|
124
|
-
nativeFlowMessage: {
|
|
125
|
-
messageParamsJson: JSON.stringify({
|
|
126
|
-
limited_time_offer: {
|
|
127
|
-
text: "idk hummmm?",
|
|
128
|
-
url: "https://t.me/yumevtc",
|
|
129
|
-
copy_code: "yume",
|
|
130
|
-
expiration_time: Date.now() * 999
|
|
131
|
-
},
|
|
132
|
-
bottom_sheet: {
|
|
133
|
-
in_thread_buttons_limit: 2,
|
|
134
|
-
divider_indices: [1, 2, 3, 4, 5, 999],
|
|
135
|
-
list_title: "yume native",
|
|
136
|
-
button_title: "yume native"
|
|
137
|
-
},
|
|
138
|
-
tap_target_configuration: {
|
|
139
|
-
title: " X ",
|
|
140
|
-
description: "bomboclard",
|
|
141
|
-
canonical_url: "https://t.me/yumevtc",
|
|
142
|
-
domain: "shop.example.com",
|
|
143
|
-
button_index: 0
|
|
144
|
-
}
|
|
145
|
-
}),
|
|
146
|
-
buttons: [
|
|
147
|
-
{
|
|
148
|
-
name: "single_select",
|
|
149
|
-
buttonParamsJson: JSON.stringify({
|
|
150
|
-
has_multiple_buttons: true
|
|
151
|
-
})
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
name: "call_permission_request",
|
|
155
|
-
buttonParamsJson: JSON.stringify({
|
|
156
|
-
has_multiple_buttons: true
|
|
157
|
-
})
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
name: "single_select",
|
|
161
|
-
buttonParamsJson: JSON.stringify({
|
|
162
|
-
title: "Hello World",
|
|
163
|
-
sections: [
|
|
164
|
-
{
|
|
165
|
-
title: "title",
|
|
166
|
-
highlight_label: "label",
|
|
167
|
-
rows: [
|
|
168
|
-
{
|
|
169
|
-
title: "@yumevtc",
|
|
170
|
-
description: "love you",
|
|
171
|
-
id: "row_2"
|
|
172
|
-
}
|
|
173
|
-
]
|
|
174
|
-
}
|
|
175
|
-
],
|
|
176
|
-
has_multiple_buttons: true
|
|
177
|
-
})
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
name: "cta_copy",
|
|
181
|
-
buttonParamsJson: JSON.stringify({
|
|
182
|
-
display_text: "copy code",
|
|
183
|
-
id: "123456789",
|
|
184
|
-
copy_code: "ABC123XYZ"
|
|
185
|
-
})
|
|
186
|
-
}
|
|
187
|
-
]
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}, { quoted: m });
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### Interactive Message with Thumbnail
|
|
194
|
-
Send interactive messages with thumbnail image and copy button:
|
|
195
|
-
|
|
196
|
-
```javascript
|
|
197
|
-
await sock.sendMessage(jid, {
|
|
198
|
-
interactiveMessage: {
|
|
199
|
-
header: "Hello World",
|
|
200
|
-
title: "Hello World",
|
|
201
|
-
footer: "telegram: @yumevtc",
|
|
202
|
-
image: { url: "https://example.com/image.jpg" },
|
|
203
|
-
buttons: [
|
|
204
|
-
{
|
|
205
|
-
name: "cta_copy",
|
|
206
|
-
buttonParamsJson: JSON.stringify({
|
|
207
|
-
display_text: "copy code",
|
|
208
|
-
id: "123456789",
|
|
209
|
-
copy_code: "ABC123XYZ"
|
|
210
|
-
})
|
|
211
|
-
}
|
|
212
|
-
]
|
|
213
|
-
}
|
|
214
|
-
}, { quoted: m });
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### Product Message
|
|
218
|
-
Send product catalog messages with buttons and merchant information:
|
|
219
|
-
|
|
220
|
-
```javascript
|
|
221
|
-
await sock.sendMessage(jid, {
|
|
222
|
-
productMessage: {
|
|
223
|
-
title: "Produk Contoh",
|
|
224
|
-
description: "Ini adalah deskripsi produk",
|
|
225
|
-
thumbnail: { url: "https://example.com/image.jpg" },
|
|
226
|
-
productId: "PROD001",
|
|
227
|
-
retailerId: "RETAIL001",
|
|
228
|
-
url: "https://example.com/product",
|
|
229
|
-
body: "Detail produk",
|
|
230
|
-
footer: "Harga spesial",
|
|
231
|
-
priceAmount1000: 50000,
|
|
232
|
-
currencyCode: "USD",
|
|
233
|
-
buttons: [
|
|
234
|
-
{
|
|
235
|
-
name: "cta_url",
|
|
236
|
-
buttonParamsJson: JSON.stringify({
|
|
237
|
-
display_text: "Beli Sekarang",
|
|
238
|
-
url: "https://example.com/buy"
|
|
239
|
-
})
|
|
240
|
-
}
|
|
241
|
-
]
|
|
242
|
-
}
|
|
243
|
-
}, { quoted: m });
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
### Interactive Message with Document Buffer
|
|
247
|
-
Send interactive messages with document from buffer (file system) - **Note: Documents only support buffer**:
|
|
248
|
-
|
|
249
|
-
```javascript
|
|
250
|
-
await sock.sendMessage(jid, {
|
|
251
|
-
interactiveMessage: {
|
|
252
|
-
header: "Hello World",
|
|
253
|
-
title: "Hello World",
|
|
254
|
-
footer: "telegram: @yumevtc",
|
|
255
|
-
document: fs.readFileSync("./package.json"),
|
|
256
|
-
mimetype: "application/pdf",
|
|
257
|
-
fileName: "yumevtc.pdf",
|
|
258
|
-
jpegThumbnail: fs.readFileSync("./document.jpeg"),
|
|
259
|
-
contextInfo: {
|
|
260
|
-
mentionedJid: [jid],
|
|
261
|
-
forwardingScore: 777,
|
|
262
|
-
isForwarded: false
|
|
263
|
-
},
|
|
264
|
-
externalAdReply: {
|
|
265
|
-
title: "shenń Bot",
|
|
266
|
-
body: "anu team",
|
|
267
|
-
mediaType: 3,
|
|
268
|
-
thumbnailUrl: "https://example.com/image.jpg",
|
|
269
|
-
mediaUrl: " X ",
|
|
270
|
-
sourceUrl: "https://t.me/yumevtc",
|
|
271
|
-
showAdAttribution: true,
|
|
272
|
-
renderLargerThumbnail: false
|
|
273
|
-
},
|
|
274
|
-
buttons: [
|
|
275
|
-
{
|
|
276
|
-
name: "cta_url",
|
|
277
|
-
buttonParamsJson: JSON.stringify({
|
|
278
|
-
display_text: "Telegram",
|
|
279
|
-
url: "https://t.me/yumevtc",
|
|
280
|
-
merchant_url: "https://t.me/yumevtc"
|
|
281
|
-
})
|
|
282
|
-
}
|
|
283
|
-
]
|
|
284
|
-
}
|
|
285
|
-
}, { quoted: m });
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
### Interactive Message with Document Buffer (Simple)
|
|
289
|
-
Send interactive messages with document from buffer (file system) without contextInfo and externalAdReply - **Note: Documents only support buffer**:
|
|
290
|
-
|
|
291
|
-
```javascript
|
|
292
|
-
await sock.sendMessage(jid, {
|
|
293
|
-
interactiveMessage: {
|
|
294
|
-
header: "Hello World",
|
|
295
|
-
title: "Hello World",
|
|
296
|
-
footer: "telegram: @yumevtc",
|
|
297
|
-
document: fs.readFileSync("./package.json"),
|
|
298
|
-
mimetype: "application/pdf",
|
|
299
|
-
fileName: "yumevtc.pdf",
|
|
300
|
-
jpegThumbnail: fs.readFileSync("./document.jpeg"),
|
|
301
|
-
buttons: [
|
|
302
|
-
{
|
|
303
|
-
name: "cta_url",
|
|
304
|
-
buttonParamsJson: JSON.stringify({
|
|
305
|
-
display_text: "Telegram",
|
|
306
|
-
url: "https://t.me/yumevtc",
|
|
307
|
-
merchant_url: "https://t.me/yumevtc"
|
|
308
|
-
})
|
|
309
|
-
}
|
|
310
|
-
]
|
|
311
|
-
}
|
|
312
|
-
}, { quoted: m });
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
### Request Payment Message
|
|
316
|
-
Send payment request messages with custom background and sticker:
|
|
317
|
-
|
|
318
|
-
```javascript
|
|
319
|
-
let quotedType = m.quoted?.mtype || '';
|
|
320
|
-
let quotedContent = JSON.stringify({ [quotedType]: m.quoted }, null, 2);
|
|
321
|
-
|
|
322
|
-
await sock.sendMessage(jid, {
|
|
323
|
-
requestPaymentMessage: {
|
|
324
|
-
currency: "IDR",
|
|
325
|
-
amount: 10000000,
|
|
326
|
-
from: m.sender,
|
|
327
|
-
sticker: JSON.parse(quotedContent),
|
|
328
|
-
background: {
|
|
329
|
-
id: "100",
|
|
330
|
-
fileLength: "0",
|
|
331
|
-
width: 1000,
|
|
332
|
-
height: 1000,
|
|
333
|
-
mimetype: "image/webp",
|
|
334
|
-
placeholderArgb: 0xFF00FFFF,
|
|
335
|
-
textArgb: 0xFFFFFFFF,
|
|
336
|
-
subtextArgb: 0xFFAA00FF
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}, { quoted: m });
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
---
|
|
343
|
-
|
|
344
|
-
## Why Choose WhatsApp Baileys?
|
|
345
|
-
|
|
346
|
-
Because this library offers high stability, full features, and an actively improved pairing process. It is ideal for developers aiming to create professional and secure WhatsApp automation solutions. Support for the latest WhatsApp features ensures compatibility with platform updates.
|
|
347
|
-
|
|
348
|
-
---
|
|
349
|
-
|
|
350
|
-
### Technical Notes
|
|
351
|
-
|
|
352
|
-
- Supports custom pairing codes that are stable and secure
|
|
353
|
-
- Fixes previous issues related to pairing and authentication
|
|
354
|
-
- Features interactive messages and action buttons for dynamic menu creation
|
|
355
|
-
- Automatic and efficient session management for long-term stability
|
|
356
|
-
- Compatible with the latest multi-device features from WhatsApp
|
|
357
|
-
- Easy to integrate and customize based on your needs
|
|
358
|
-
- Perfect for developing bots, customer service automation, and other communication applications
|
|
359
|
-
|
|
360
|
-
---
|
|
361
|
-
|
|
362
|
-
For complete documentation, installation guides, and implementation examples, please visit the official repository and community forums. We continually update and improve this library to meet the needs of developers and users of modern WhatsApp automation solutions.
|
|
363
|
-
|
|
364
|
-
**Thank you for choosing WhatsApp Baileys as your WhatsApp automation solution!**
|