@ryuu-reinzz/haruka-lib 3.7.0 → 4.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +496 -133
- package/main/index.js +20 -4
- package/main/socket.js +1708 -3
- package/main/sticker-engine/image-to-webp.js +5 -5
- package/main/sticker-engine/video-to-webp.js +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,143 +1,506 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
``` javascript
|
|
45
|
-
conn.sendButton(m.chat, {
|
|
46
|
-
caption: "Haruka here!",
|
|
47
|
-
image: { url: global.thumbnail },
|
|
48
|
-
footer: global.ownername,
|
|
49
|
-
buttons: [
|
|
50
|
-
{
|
|
51
|
-
name: "cta_url",
|
|
52
|
-
buttonParamsJson: JSON.stringify({
|
|
53
|
-
display_text: "View Link",
|
|
54
|
-
url: global.thumbnail
|
|
55
|
-
})
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
bottom_sheet: true, //kalau mau button dalam button
|
|
59
|
-
bottom_name: "Bottom sheet"
|
|
60
|
-
});
|
|
1
|
+
# @ryuu-reinzz/haruka-lib - Advanced WhatsApp Interactive Message Builder
|
|
2
|
+
|
|
3
|
+
**@ryuu-reinzz/haruka-lib** adalah library mutakhir untuk mempermudah pembuatan pesan interaktif di WhatsApp menggunakan library **Baileys**. Dengan pendekatan *fluent chaining API*, Anda dapat membuat komponen kompleks seperti **Buttons, Carousel Cards, Native Flows, hingga AI Rich Response Payloads** (gaya enkripsi enkapsulasi AI WhatsApp) dengan struktur kode yang bersih, elegan, dan sangat *scalable*.
|
|
4
|
+
---
|
|
5
|
+
## 📑 Watermark & Credits
|
|
6
|
+
|
|
7
|
+
> ### ⚠️ DO NOT REMOVE THIS WATERMARK
|
|
8
|
+
> **@ryuu-reinzz/haruka-lib - Advanced WhatsApp Interactive Message Builder**
|
|
9
|
+
> Built for creating buttons, carousels, native flows, and AI rich response payloads using Baileys with fluent chaining, flexible payload customization, and scalable architecture for modern bot development.
|
|
10
|
+
>
|
|
11
|
+
> * **Runtime:** Baileys: `baileys` (Latest)
|
|
12
|
+
> * **Created by:** Nixel
|
|
13
|
+
> * **Contributors:**
|
|
14
|
+
> * ~ Ahmad tumbuh kembang
|
|
15
|
+
> * ~ RyuuReinzz
|
|
16
|
+
>
|
|
17
|
+
> **Owner WhatsApp: [wa.me/6288246552068](https://wa.me/6288246552068) RyuuReinzz**
|
|
18
|
+
> *(Added "messageBuilder" wrapper, "extendSocketsBotz", Owner of @ryuu-reinzz/baileys)*
|
|
19
|
+
>
|
|
20
|
+
> **WhatsApp Creator:** [wa.me/6282139672290](https://wa.me/6288246552068)
|
|
21
|
+
> **Channel:** [https://whatsapp.com/channel/0029VbCV1ck8fewpdNb2TY2k](https://whatsapp.com/channel/0029VbCV1ck8fewpdNb2TY2k)
|
|
22
|
+
>
|
|
23
|
+
> *Note: This project is being sold because it has been modified and has been added to many other things that make it more valuable.*
|
|
24
|
+
>
|
|
25
|
+
> **Copyright (c) 2026 Nixel**
|
|
26
|
+
> **Copyright (c) 2026 RyuuReinzz**
|
|
27
|
+
---
|
|
28
|
+
## 🚀 Fitur Utama
|
|
29
|
+
* **Fluent Chaining (`messageBuilder`)**: Menulis kode pembuatan pesan berantai yang rapi (`.setType().setTitle().setBody().send()`).
|
|
30
|
+
* **Native Flow Messages (Button V1)**: Dukungan penuh untuk *quick replies, URL redirections, CTA Calls, Reminders, Address Input*, dan *Single Select Lists* dengan opsi penyesuaian ikon.
|
|
31
|
+
* **Buttons V2**: Formulasi tombol interaktif klasik berbasis *location data fallback* dan rendering thumbnail instan.
|
|
32
|
+
* **Carousel Cards**: Mengirim deretan *slider* kartu interaktif berbasis media (Gambar/Video) sekaligus menggunakan integrasi instansiasi internal.
|
|
33
|
+
* **AI Rich Response (WhatsApp AI Format)**: Rendering elemen super premium eksklusif Meta AI seperti **Markdown Text, Code Highlighting Tokenizer, Data Tables, Reels/HScroll Layout, Product Showcase, Social Media Posts,** hingga rendering ekspresi **LaTeX** ke Gambar.
|
|
34
|
+
* **Socket Injection Extensions**: Menambahkan *prototype/method* tambahan langsung ke objek `socket` Baileys Anda (`sendAlbum`, `sendStickerPack`, `sendOrder`, `getPNFromLid`, dll).
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 🛠️ Instalasi & Persiapan
|
|
38
|
+
### Prasyarat Dependensi
|
|
39
|
+
Pastikan project Anda telah menginstal beberapa modul inti berikut:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install baileys sharp node-fetch @ryuu-reinzz/haruka-lib
|
|
61
43
|
```
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
totalAmount1000: 500000000,
|
|
79
|
-
totalCurrencyCode: "IDR"
|
|
80
|
-
}, { quoted: m, mentions: [m.sender] });
|
|
81
|
-
```
|
|
82
|
-
Hasil Output:
|
|
83
|
-
<img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendOrder.jpg" width="300" />
|
|
84
|
-
|
|
85
|
-
## 3. Send Album
|
|
86
|
-
*Cocok untuk mengirim katalog produk atau galeri foto tanpa memenuhi chat.*
|
|
87
|
-
|
|
88
|
-
``` javascript
|
|
89
|
-
conn.sendAlbum(m.chat, [
|
|
90
|
-
{ image: { url: global.thumbnail }, caption: "Gambar 1" },
|
|
91
|
-
{ image: { url: global.thumbnail }, caption: "Gambar 2" },
|
|
92
|
-
{ image: fs.readFileSync("./image.jpg"), caption: "Stiker lucu" }
|
|
93
|
-
], { quoted: m });
|
|
94
|
-
```
|
|
95
|
-
Hasil Output:
|
|
96
|
-
<img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendAlbum.jpg" width="300" />
|
|
97
|
-
|
|
98
|
-
## 4. Send Card (Carousel)
|
|
99
|
-
*Fitur tercanggih untuk membuat menu bot yang bisa digeser (slide) ke samping.*
|
|
100
|
-
|
|
101
|
-
``` javascript
|
|
102
|
-
conn.sendCard(m.chat, {
|
|
103
|
-
text: "Bot Thumbnail",
|
|
104
|
-
footer: "© Ryuu Reinzz",
|
|
105
|
-
quoted: m,
|
|
106
|
-
sender: m.sender,
|
|
107
|
-
cards: [
|
|
108
|
-
{
|
|
109
|
-
image: global.thumbnail,
|
|
110
|
-
caption: "Thumbnail 1",
|
|
111
|
-
buttons: [{ name: "cta_url", buttonParamsJson: JSON.stringify({ display_text: "Visit", url: "https://google.com" }) }]
|
|
112
|
-
}
|
|
113
|
-
]
|
|
44
|
+
### Inisialisasi Ekstensi addProperty
|
|
45
|
+
Untuk menyuntikkan seluruh fitur dari @ryuu-reinzz/haruka-lib ke dalam instance bot Baileys Anda, panggil fungsi ekspor utama pada berkas koneksi bot Anda:
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
import makeWASocket, { useMultiFileAuthState } from 'baileys';
|
|
49
|
+
import {
|
|
50
|
+
addProperty,
|
|
51
|
+
Button,
|
|
52
|
+
ButtonV2,
|
|
53
|
+
Carousel,
|
|
54
|
+
AIRich
|
|
55
|
+
} from '@ryuu-reinzz/haruka-lib';
|
|
56
|
+
const { state, saveCreds } = await useMultiFileAuthState('session');
|
|
57
|
+
const sock = makeWASocket({
|
|
58
|
+
auth: state,
|
|
59
|
+
printQRInTerminal: true
|
|
114
60
|
});
|
|
61
|
+
// Suntikkan properti @ryuu-reinzz/haruka-lib ke dalam socket Baileys
|
|
62
|
+
addProperty(sock, await import('baileys'));
|
|
115
63
|
```
|
|
116
|
-
##
|
|
117
|
-
|
|
64
|
+
## 📊 Detail Parameter & Opsi Method (API Reference)
|
|
65
|
+
### 1. Kelas Button (Native Flow / Button V1)
|
|
118
66
|
|
|
119
|
-
|
|
120
|
-
|
|
67
|
+
| Method | Parameter | Tipe Data | Deskripsi / Opsi Nilai |
|
|
68
|
+
| :--- | :--- | :--- | :--- |
|
|
69
|
+
| setTitle(text) | text | String | Judul di bagian paling atas (*Header*). |
|
|
70
|
+
| setSubtitle(text) | text | String | Sub-judul / teks sekunder di bawah judul. |
|
|
71
|
+
| setBody(text) | text | String | Konten teks utama di tengah bubble chat. |
|
|
72
|
+
| setFooter(text) | text | String | Teks kecil abu-abu di bagian bawah pesan. |
|
|
73
|
+
| setImage(url) | url | String | Mengatur media gambar pada header berupa URL / Buffer. |
|
|
74
|
+
| addReply(txt, id, opt) | txt, id, opt | String, String, Object | Tombol Quick Reply. Opsi ikon: { icon: 'DEFAULT' }, { icon: 'REVIEW' }, dll. |
|
|
75
|
+
| addUrl(txt, url, vw, opt) | txt, url, vw, opt | String, String, Boolean, Object | Tombol buka tautan. vw (webview) = true/false. Opsi ikon: { icon: 'PROMOTION' }. |
|
|
76
|
+
| addCopy(txt, code, opt) | txt, code, opt | String, String, Object | Tombol salin kode cepat. Opsi ikon: { icon: 'DOCUMENT' }. |
|
|
77
|
+
| addSelection(title) | title | String | Menginisialisasi komponen menu list baru. |
|
|
78
|
+
| makeSection(title) | title | String | Membuat kategori/seksi baru di dalam list menu terakhir. |
|
|
79
|
+
| makeRow(h, t, d, id) | h, t, d, id | String, String, String, String | Mengisi item baris. h (header), t (title), d (description), id (command). | <br> ###
|
|
121
80
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
81
|
+
### 2. Kelas ButtonV2 (Classic Fallback Buttons)
|
|
82
|
+
| Method | Parameter | Tipe Data | Deskripsi |
|
|
83
|
+
| :--- | :--- | :--- | :--- |
|
|
84
|
+
| setTitle(text) | text | String | Judul pesan. |
|
|
85
|
+
| setSubtitle(text) | text | String | Sub-judul pesan. |
|
|
86
|
+
| setBody(text) | text | String | Isi konten utama teks pesan. |
|
|
87
|
+
| setFooter(text) | text | String | Catatan kaki pesan. |
|
|
88
|
+
| setThumbnail(url) | url | String | Mengatur thumbnail kecil di samping/dalam pesan. |
|
|
89
|
+
| addButton(txt, id) | txt, id | String, String | Menambahkan tombol interaktif klasik. |
|
|
90
|
+
|
|
91
|
+
### 3. Skema Object Data AIRich Components
|
|
92
|
+
#### A. Properti Objek addProduct
|
|
93
|
+
```javascript
|
|
94
|
+
{
|
|
95
|
+
title: String, // Nama produk resmi
|
|
96
|
+
brand: String, // Nama brand / pemilik produk
|
|
97
|
+
price: String, // Harga normal (Contoh: "Rp 1000")
|
|
98
|
+
sale_price: String, // Harga diskon (Contoh: "Rp 0")
|
|
99
|
+
product_url: String, // Tautan saat produk diklik (Gunakan key 'url' jika HScroll Array)
|
|
100
|
+
icon_url: String, // Logo brand mini di pojok (Gunakan key 'icon' jika HScroll Array)
|
|
101
|
+
image_url: String // Gambar visual produk utama (Gunakan key 'image' jika HScroll Array)
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
#### B. Properti Objek addReels
|
|
105
|
+
```javascript
|
|
106
|
+
{
|
|
107
|
+
username: String, // Nama pembuat konten video
|
|
108
|
+
profile_url: String, // Foto avatar profil pembuat
|
|
109
|
+
thumbnail: String, // Cover preview video Reels
|
|
110
|
+
url: String, // Link redirect eksternal video
|
|
111
|
+
title: String, // Judul pendek / caption video
|
|
112
|
+
like: Number, // Jumlah visualisasi Like (e.g. 12000)
|
|
113
|
+
share: Number, // Jumlah visualisasi Share (e.g. 500)
|
|
114
|
+
view: Number, // Jumlah total tayangan (e.g. 999999)
|
|
115
|
+
source: String, // Tag asal platform (Contoh: 'IG', 'FB')
|
|
116
|
+
verified: Boolean // Lencana centang biru profil (true / false)
|
|
117
|
+
}
|
|
128
118
|
```
|
|
129
|
-
|
|
130
|
-
|
|
119
|
+
#### C. Properti Objek addPost
|
|
120
|
+
```javascript
|
|
121
|
+
{
|
|
122
|
+
profile_url: String, // Foto avatar profil
|
|
123
|
+
username: String, // Nama akun
|
|
124
|
+
title: String, // Judul postingan
|
|
125
|
+
subtitle: String, // Sub-judul / detail lokasi
|
|
126
|
+
caption: String, // Deskripsi status postingan
|
|
127
|
+
verified: Boolean, // Status verifikasi centang biru
|
|
128
|
+
url: String, // Tautan utama postingan
|
|
129
|
+
thumbnail: String, // Gambar konten utama postingan
|
|
130
|
+
source: String, // Sumber platform: 'INSTAGRAM', 'FACEBOOK', 'THREADS', dsb.
|
|
131
|
+
footer: String, // Catatan kaki di dalam frame post
|
|
132
|
+
deeplink: String, // Tautan langsung aplikasi internal
|
|
133
|
+
icon: String, // Ikon kecil platform pendukung
|
|
134
|
+
orientation: String, // Orientasi layout gambar: 'LANDSCAPE' atau 'PORTRAIT'
|
|
135
|
+
post_type: String, // Tipe postingan: 'PHOTO' atau 'VIDEO'
|
|
136
|
+
comment: Number, // Statistik Jumlah Komentar
|
|
137
|
+
share: Number, // Statistik Jumlah Bagikan
|
|
138
|
+
like: Number // Statistik Jumlah Suka
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
## 📖 Contoh Penggunaan & Implementasi Kode
|
|
142
|
+
@ryuu-reinzz/haruka-lib menyediakan dua metode penggunaan: menggunakan **sock.messageBuilder(jid)** (Sangat Direkomendasikan karena mendukung penulisan rantai metode langsung) atau menginisialisasi kelasnya secara mandiri via operator new.
|
|
143
|
+
### 🔄 Sintaks Pembungkus (Wrapper Syntax) messageBuilder
|
|
144
|
+
Pembungkus pintar ini mengekspos semua metode kelas target secara dinamis setelah tipe ditentukan.
|
|
145
|
+
```javascript
|
|
146
|
+
// Contoh pola pemanggilan umum via messageBuilder
|
|
147
|
+
await sock.messageBuilder(m.chat, { quoted: m })
|
|
148
|
+
.setType("Button") // Menerima: "Button" | "ButtonV2" | "Carousel" | "AIRich"
|
|
149
|
+
.setTitle("Judul")
|
|
150
|
+
.setBody("Isi Pesan")
|
|
151
|
+
.addReply("Tombol 1", "id_1")
|
|
152
|
+
.send();
|
|
153
|
+
```
|
|
154
|
+
### 1. Kelas Button (Native Flow Message)
|
|
155
|
+
Pembuatan komponen tombol canggih WhatsApp (*Native Flow Components*) lengkap dengan penyesuaian ikon interaktif.
|
|
156
|
+
#### 💻 Contoh Menggunakan Operator new:
|
|
157
|
+
```javascript
|
|
158
|
+
await new Button(conn)
|
|
159
|
+
.setTitle('🚀 Ryuu')
|
|
160
|
+
.setSubtitle('Interactive Message')
|
|
161
|
+
.setBody('Pilih menu di bawah')
|
|
162
|
+
.setFooter('© Ryuu')
|
|
163
|
+
.setImage('[https://cdn.ornzora.eu.cc/b57c0d1e-d7a6-4277-8739-8f6b1d9894e6-FIORA.jpg](https://cdn.ornzora.eu.cc/b57c0d1e-d7a6-4277-8739-8f6b1d9894e6-FIORA.jpg)')
|
|
164
|
+
.addReply('📦 Menu', '.menu', { icon: 'DEFAULT' })
|
|
165
|
+
.addReply('👤 Profile', '.profile', { icon: 'REVIEW' })
|
|
166
|
+
.addUrl('🌐 Website', '[https://example.com](https://example.com)', true, { icon: 'PROMOTION' })
|
|
167
|
+
.addCopy('📋 Copy Code', 'NIX-2026', { icon: 'DOCUMENT' })
|
|
168
|
+
.addSelection('📚 Pilih Kategori')
|
|
169
|
+
.makeSection('Main Menu')
|
|
170
|
+
.makeRow('🔥 HOT', 'Downloader', 'Download social media', '.dl')
|
|
171
|
+
.makeRow('⚡ FAST', 'AI Chat', 'Chat dengan AI', '.ai')
|
|
172
|
+
.send(m.chat, { quoted: m });
|
|
173
|
+
```
|
|
174
|
+
#### 🔄 Menggunakan messageBuilder:
|
|
175
|
+
```javascript
|
|
176
|
+
await sock.messageBuilder(m.chat, { quoted: m })
|
|
177
|
+
.setType('Button')
|
|
178
|
+
.setTitle('🚀 Ryuu')
|
|
179
|
+
.setSubtitle('Interactive Message')
|
|
180
|
+
.setBody('Pilih menu di bawah')
|
|
181
|
+
.addReply('📦 Menu', '.menu', { icon: 'DEFAULT' })
|
|
182
|
+
.addSelection('📚 Pilih Kategori')
|
|
183
|
+
.makeSection('Main Menu')
|
|
184
|
+
.makeRow('🔥 HOT', 'Downloader', 'Download social media', '.dl')
|
|
185
|
+
.send();
|
|
186
|
+
```
|
|
187
|
+
### 2. Kelas ButtonV2 (Classic Buttons)
|
|
188
|
+
Formulasi alternatif tombol interaktif klasik berbasis *location data fallback* dan rendering thumbnail instan.
|
|
189
|
+
#### 💻 Contoh Menggunakan Operator new:
|
|
190
|
+
```javascript
|
|
191
|
+
await new ButtonV2(conn)
|
|
192
|
+
.setTitle('🚀 Ryuu')
|
|
193
|
+
.setSubtitle('Buttons Message')
|
|
194
|
+
.setBody('Halo dunia')
|
|
195
|
+
.setFooter('Footer Message')
|
|
196
|
+
.setThumbnail('[https://cdn.ornzora.eu.cc/4d2905ce-3707-4ec0-998a-68a3d851629f-FIORA.jpg](https://cdn.ornzora.eu.cc/4d2905ce-3707-4ec0-998a-68a3d851629f-FIORA.jpg)')
|
|
197
|
+
.addButton('📦 Menu', '.menu')
|
|
198
|
+
.addButton('👤 Profile', '.profile')
|
|
199
|
+
.send(m.chat);
|
|
200
|
+
```
|
|
201
|
+
#### 🔄 Menggunakan messageBuilder:
|
|
202
|
+
```javascript
|
|
203
|
+
await sock.messageBuilder(m.chat)
|
|
204
|
+
.setTitle('🚀 Ryuu')
|
|
205
|
+
.setSubtitle('Buttons Message')
|
|
206
|
+
.setBody('Halo dunia')
|
|
207
|
+
.setFooter('Footer Message')
|
|
208
|
+
.setThumbnail(https://cdn.ornzora.eu.cc/4d2905ce-3707-4ec0-998a-68a3d851629f-FIORA.jpg')
|
|
209
|
+
.addButton('📦 Menu', '.menu')
|
|
210
|
+
.addButton('👤 Profile', '.profile')
|
|
211
|
+
.send();
|
|
212
|
+
```
|
|
213
|
+
### 3. Kelas Carousel (Interactive Cards Slider)
|
|
214
|
+
Mengirimkan beberapa kartu media interaktif horizontal yang dapat digeser (*swipe*) oleh pengguna menggunakan fungsionalitas penarikan .toCard().
|
|
215
|
+
#### 💻 Contoh Menggunakan Operator new:
|
|
216
|
+
```javascript
|
|
217
|
+
await new Carousel(conn)
|
|
218
|
+
.setBody('🛍️ Product List')
|
|
219
|
+
.setFooter('Swipe untuk lihat')
|
|
220
|
+
.addCard(
|
|
221
|
+
await new Button(conn)
|
|
222
|
+
.setTitle('🍔 Burger')
|
|
223
|
+
.setBody('Burger terenak')
|
|
224
|
+
.setFooter('$5')
|
|
225
|
+
.setImage('https://cdn.ornzora.eu.cc/36df8c36-c74e-4dc2-bc03-87893f373cb4-FIORA.jpg')
|
|
226
|
+
.addReply('🛒 Buy', '.buy burger')
|
|
227
|
+
.toCard()
|
|
228
|
+
)
|
|
229
|
+
.addCard(
|
|
230
|
+
await new Button(conn)
|
|
231
|
+
.setTitle('🍕 Pizza')
|
|
232
|
+
.setBody('Pizza mozzarella')
|
|
233
|
+
.setFooter('$7')
|
|
234
|
+
.setImage('https://cdn.ornzora.eu.cc/36df8c36-c74e-4dc2-bc03-87893f373cb4-FIORA.jpg')
|
|
235
|
+
.addReply('🛒 Buy', '.buy pizza')
|
|
236
|
+
.toCard()
|
|
237
|
+
)
|
|
238
|
+
.send(m.chat, { quoted: m });
|
|
239
|
+
```
|
|
240
|
+
#### 🔄 Menggunakan messageBuilder:
|
|
241
|
+
```javascript
|
|
242
|
+
await sock.messageBuilder(m.chat, { quoted: m })
|
|
243
|
+
.setBody('🛍️ Product List')
|
|
244
|
+
.setFooter('Swipe untuk lihat')
|
|
245
|
+
.addCard(
|
|
246
|
+
await new Button(conn)
|
|
247
|
+
.setTitle('🍔 Burger')
|
|
248
|
+
.setBody('Burger terenak')
|
|
249
|
+
.setFooter('$5')
|
|
250
|
+
.setImage('https://cdn.ornzora.eu.cc/36df8c36-c74e-4dc2-bc03-87893f373cb4-FIORA.jpg')
|
|
251
|
+
.addReply('🛒 Buy', '.buy burger')
|
|
252
|
+
.toCard()
|
|
253
|
+
)
|
|
254
|
+
.addCard(
|
|
255
|
+
await new Button(conn)
|
|
256
|
+
.setTitle('🍕 Pizza')
|
|
257
|
+
.setBody('Pizza mozzarella')
|
|
258
|
+
.setFooter('$7')
|
|
259
|
+
.setImage('https://cdn.ornzora.eu.cc/36df8c36-c74e-4dc2-bc03-87893f373cb4-FIORA.jpg')
|
|
260
|
+
.addReply('🛒 Buy', '.buy pizza')
|
|
261
|
+
.toCard()
|
|
262
|
+
)
|
|
263
|
+
.send();
|
|
264
|
+
```
|
|
265
|
+
### 4. Kelas AIRich (Meta AI Response Styles)
|
|
266
|
+
Fitur premium berkelas tinggi untuk mereplikasi visualisasi platform Meta AI di WhatsApp resmi (Tabel data, Pewarnaan kode sintaks, Rendering rumus gambar LaTeX, Layout Reels, Galeri grid, Showcase produk komersial, & Social Post mockup).
|
|
267
|
+
#### Panduan Khusus Ekstraksi Sintaks Teks addText:
|
|
268
|
+
* **Hyperlink:** [Teks Di Sini](url_tujuan) -> Contoh: [Google](https://google.com)
|
|
269
|
+
* **Auto Citation:** [](url_rujukan) -> Contoh: [](https://openai.com)
|
|
270
|
+
* **LaTeX Render Engine:** [Identifier|Width|Height|Font_Height|Padding]<url_gambar> -> Contoh: [Shiroko|1429|1897]<https://cdn.link.png>
|
|
271
|
+
|
|
272
|
+
#### 💻 Contoh Menggunakan Operator new:
|
|
273
|
+
|
|
274
|
+
```javascript
|
|
275
|
+
await new AIRich(sock)
|
|
276
|
+
.setType('AIRich')
|
|
277
|
+
.setTitle('🚀 Ryuu')
|
|
278
|
+
.setFooter('© Haruka')
|
|
279
|
+
.addSuggest(['Ryuu', 'Ryuu', 'Haruka'])
|
|
280
|
+
.addTip('Ini adalah text tip (Metadata Text)')
|
|
281
|
+
.addText(`# Halo Dunia
|
|
282
|
+
=={ Yellow Text }==
|
|
131
283
|
|
|
132
|
-
|
|
133
|
-
|
|
284
|
+
Ini hyperlink:
|
|
285
|
+
[Google](https://google.com)
|
|
134
286
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
await conn.getLidFromPN(m, "6288246552068@s.whatsapp.net");
|
|
287
|
+
Ini auto citation:
|
|
288
|
+
[](https://openai.com)
|
|
138
289
|
|
|
139
|
-
|
|
140
|
-
|
|
290
|
+
Ini LaTeX:
|
|
291
|
+
[Shiroko|1429|1897]<https://cdn.ornzora.eu.cc/a3a756f2-6bb8-4814-a024-c325524a2308-FIORA.png>`)
|
|
292
|
+
.addProduct({
|
|
293
|
+
title: 'Nama Produk',
|
|
294
|
+
brand: 'Ryuu',
|
|
295
|
+
price: 'Rp 1000',
|
|
296
|
+
sale_price: 'Rp 0',
|
|
297
|
+
product_url: 'https://wa.me/6288246552068',
|
|
298
|
+
icon_url: "https://static.nike.com/a/images/t_PDP_1280_v1/f_auto,q_auto:eco/additional_image_1.png",
|
|
299
|
+
image_url: 'https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-10.jpg'
|
|
300
|
+
})
|
|
301
|
+
.addCode('javascript', `class Ryuu {
|
|
302
|
+
static hello() {
|
|
303
|
+
return 'Hello World';
|
|
304
|
+
}
|
|
305
|
+
}`)
|
|
306
|
+
.addText('HScroll Product (Array of Object Input):')
|
|
307
|
+
.addProduct(Array(5).fill({
|
|
308
|
+
title: global.namabot,
|
|
309
|
+
brand: 'Ryuu',
|
|
310
|
+
price: 'Rp 1000',
|
|
311
|
+
sale_price: 'Rp 0',
|
|
312
|
+
url: 'https://wa.me/6288246552068',
|
|
313
|
+
icon: "https://static.nike.com/a/images/t_PDP_1280_v1/f_auto,q_auto:eco/additional_image_1.png",
|
|
314
|
+
image: "https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-10.jpg"
|
|
315
|
+
}))
|
|
316
|
+
.addTable([
|
|
317
|
+
['Nama', 'Role'],
|
|
318
|
+
['Ryuu', 'Developer'],
|
|
319
|
+
['Haruka', 'Assistant']
|
|
320
|
+
])
|
|
321
|
+
.addSource([
|
|
322
|
+
['https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-09.jpg', 'https://github.com/reinzz556/', 'GitHub'],
|
|
323
|
+
['https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-09.jpg', 'https://api.ryuu-dev.my.id/', 'Haruka Botz']
|
|
324
|
+
])
|
|
325
|
+
.addImage('https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-07.jpg')
|
|
326
|
+
.addVideo("https://api.ryuu-dev.my.id/2026-06-01-064748592.mp4|10")
|
|
327
|
+
.addReels(Array(5).fill({
|
|
328
|
+
username: 'Ryuu',
|
|
329
|
+
profile_url: 'https://api.ryuu-dev.my.id/logo.png',
|
|
330
|
+
thumbnail: 'https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-08.jpg',
|
|
331
|
+
url: 'https://api.ryuu-dev.my.id/',
|
|
332
|
+
title: 'Demo Reel',
|
|
333
|
+
like: 12000,
|
|
334
|
+
share: 500,
|
|
335
|
+
view: 999999,
|
|
336
|
+
source: 'IG',
|
|
337
|
+
verified: true
|
|
338
|
+
}))
|
|
339
|
+
.addPost(Array(5).fill({
|
|
340
|
+
profile_url: "https://api.ryuu-dev.my.id/logo.png",
|
|
341
|
+
username: 'Ryuu',
|
|
342
|
+
title: "Demo Post",
|
|
343
|
+
subtitle: 'Ryuu',
|
|
344
|
+
caption: 'hii~ im haruka, just quietly observing things around here.',
|
|
345
|
+
verified: true,
|
|
346
|
+
url: 'https://api.ryuu-dev.my.id/',
|
|
347
|
+
thumbnail: 'https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-07.jpg',
|
|
348
|
+
source: 'INSTAGRAM',
|
|
349
|
+
footer: 'Haruka',
|
|
350
|
+
deeplink: 'https://api.ryuu-dev.my.id/',
|
|
351
|
+
icon: "https://api.ryuu-dev.my.id/logo.png",
|
|
352
|
+
orientation: 'LANDSCAPE',
|
|
353
|
+
post_type: 'PHOTO',
|
|
354
|
+
comment: 1,
|
|
355
|
+
share: 1,
|
|
356
|
+
like: 1
|
|
357
|
+
}))
|
|
358
|
+
.send(m.chat, { quoted: m });
|
|
141
359
|
```
|
|
142
|
-
|
|
143
|
-
|
|
360
|
+
#### 🔄 Menggunakan messageBuilder:
|
|
361
|
+
|
|
362
|
+
```javascript
|
|
363
|
+
await sock.messageBuilder(m.chat, { quoted: m })
|
|
364
|
+
.setType('AIRich')
|
|
365
|
+
.setTitle('🚀 Ryuu')
|
|
366
|
+
.setFooter('© Haruka')
|
|
367
|
+
.addSuggest(['Ryuu', 'Ryuu', 'Haruka'])
|
|
368
|
+
.addTip('Ini adalah text tip (Metadata Text)')
|
|
369
|
+
.addText(`# Halo Dunia
|
|
370
|
+
=={ Yellow Text }==
|
|
371
|
+
|
|
372
|
+
Ini hyperlink:
|
|
373
|
+
[Google](https://google.com)
|
|
374
|
+
|
|
375
|
+
Ini auto citation:
|
|
376
|
+
[](https://openai.com)
|
|
377
|
+
|
|
378
|
+
Ini LaTeX:
|
|
379
|
+
[Shiroko|1429|1897]<https://cdn.ornzora.eu.cc/a3a756f2-6bb8-4814-a024-c325524a2308-FIORA.png>`)
|
|
380
|
+
.addProduct({
|
|
381
|
+
title: 'Nama Produk',
|
|
382
|
+
brand: 'Ryuu',
|
|
383
|
+
price: 'Rp 1000',
|
|
384
|
+
sale_price: 'Rp 0',
|
|
385
|
+
product_url: 'https://wa.me/6288246552068',
|
|
386
|
+
icon_url: "https://static.nike.com/a/images/t_PDP_1280_v1/f_auto,q_auto:eco/additional_image_1.png",
|
|
387
|
+
image_url: 'https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-10.jpg'
|
|
388
|
+
})
|
|
389
|
+
.addCode('javascript', `class Ryuu {
|
|
390
|
+
static hello() {
|
|
391
|
+
return 'Hello World';
|
|
392
|
+
}
|
|
393
|
+
}`)
|
|
394
|
+
.addText('HScroll Product (Array of Object Input):')
|
|
395
|
+
.addProduct(Array(5).fill({
|
|
396
|
+
title: global.namabot,
|
|
397
|
+
brand: 'Ryuu',
|
|
398
|
+
price: 'Rp 1000',
|
|
399
|
+
sale_price: 'Rp 0',
|
|
400
|
+
url: 'https://wa.me/6288246552068',
|
|
401
|
+
icon: "https://static.nike.com/a/images/t_PDP_1280_v1/f_auto,q_auto:eco/additional_image_1.png",
|
|
402
|
+
image: "https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-10.jpg"
|
|
403
|
+
}))
|
|
404
|
+
.addTable([
|
|
405
|
+
['Nama', 'Role'],
|
|
406
|
+
['Ryuu', 'Developer'],
|
|
407
|
+
['Haruka', 'Assistant']
|
|
408
|
+
])
|
|
409
|
+
.addSource([
|
|
410
|
+
['https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-09.jpg', 'https://github.com/reinzz556/', 'GitHub'],
|
|
411
|
+
['https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-09.jpg', 'https://api.ryuu-dev.my.id/', 'Haruka Botz']
|
|
412
|
+
])
|
|
413
|
+
.addImage('https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-07.jpg')
|
|
414
|
+
.addVideo("https://api.ryuu-dev.my.id/2026-06-01-064748592.mp4|10")
|
|
415
|
+
.addReels(Array(5).fill({
|
|
416
|
+
username: 'Ryuu',
|
|
417
|
+
profile_url: 'https://api.ryuu-dev.my.id/logo.png',
|
|
418
|
+
thumbnail: 'https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-08.jpg',
|
|
419
|
+
url: 'https://api.ryuu-dev.my.id/',
|
|
420
|
+
title: 'Demo Reel',
|
|
421
|
+
like: 12000,
|
|
422
|
+
share: 500,
|
|
423
|
+
view: 999999,
|
|
424
|
+
source: 'IG',
|
|
425
|
+
verified: true
|
|
426
|
+
}))
|
|
427
|
+
.addPost(Array(5).fill({
|
|
428
|
+
profile_url: "https://api.ryuu-dev.my.id/logo.png",
|
|
429
|
+
username: 'Ryuu',
|
|
430
|
+
title: "Demo Post",
|
|
431
|
+
subtitle: 'Ryuu',
|
|
432
|
+
caption: 'hii~ im haruka, just quietly observing things around here.',
|
|
433
|
+
verified: true,
|
|
434
|
+
url: 'https://api.ryuu-dev.my.id/',
|
|
435
|
+
thumbnail: 'https://api.ryuu-dev.offc.my.id/src/assest/mahiru/Mahiru-07.jpg',
|
|
436
|
+
source: 'INSTAGRAM',
|
|
437
|
+
footer: 'Haruka',
|
|
438
|
+
deeplink: 'https://api.ryuu-dev.my.id/',
|
|
439
|
+
icon: "https://api.ryuu-dev.my.id/logo.png",
|
|
440
|
+
orientation: 'LANDSCAPE',
|
|
441
|
+
post_type: 'PHOTO',
|
|
442
|
+
comment: 1,
|
|
443
|
+
share: 1,
|
|
444
|
+
like: 1
|
|
445
|
+
}))
|
|
446
|
+
.send();
|
|
447
|
+
```
|
|
448
|
+
## 🔌 Prototip Tambahan Socket (sock.*)
|
|
449
|
+
@ryuu-reinzz/haruka-lib secara otomatis menyuntikkan fungsi pembantu tingkat tinggi ke dalam variabel socket Baileys Anda melalui method addProperty:
|
|
450
|
+
### A. sock.sendAlbum(jid, items, options)
|
|
451
|
+
Mengirimkan album galeri media terkompresi (kumpulan gambar/video) dalam satu kesatuan pesan tanpa berantakan.
|
|
452
|
+
|
|
453
|
+
```javascript
|
|
454
|
+
await sock.sendAlbum(m.chat, [
|
|
455
|
+
{ image: { url: "https://placehold.co/600x400.png" }, caption: "Foto Keren 1" },
|
|
456
|
+
{ image: { url: "https://placehold.co/600x400.png" }, caption: "Foto Keren 2" }
|
|
457
|
+
], { quoted: m });
|
|
458
|
+
```
|
|
459
|
+
### B. sock.sendStickerPack(jid, packData, options)
|
|
460
|
+
Mengirimkan file webp secara massal berwujud Paket Stiker Resmi (*Third Party Sticker Pack*).
|
|
461
|
+
|
|
462
|
+
```javascript
|
|
463
|
+
await sock.sendStickerPack(m.chat, {
|
|
464
|
+
name: "Stiker Pack Haruka V2",
|
|
465
|
+
publisher: "RyuuReinzz Dev",
|
|
466
|
+
description: "Kumpulan stiker interaktif buatan bot",
|
|
467
|
+
cover: Buffer.from("..."), // Buffer gambar untuk cover kemasan stiker
|
|
468
|
+
stickers: [
|
|
469
|
+
{ data: fs.readFileSync("./sticker1.webp"), emojis: ["🤣", "🔥"] },
|
|
470
|
+
{ data: fs.readFileSync("./sticker2.webp"), emojis: ["❤️"] }
|
|
471
|
+
]
|
|
472
|
+
});
|
|
473
|
+
```
|
|
474
|
+
### C. sock.sendOrder(jid, orderData, options)
|
|
475
|
+
Mengirim kartu transaksi pesanan komersial formal katalog bisnis.
|
|
476
|
+
|
|
477
|
+
```javascript
|
|
478
|
+
await sock.sendOrder(m.chat, {
|
|
479
|
+
orderId: "ORDER-ID-99823",
|
|
480
|
+
itemCount: 2,
|
|
481
|
+
status: 1, // INQUIRY
|
|
482
|
+
orderTitle: "Pembelian Source Code Haruka Bot",
|
|
483
|
+
message: "Terima kasih telah berbelanja, mohon tunggu verifikasi pembayaran QRIS Midtrans.",
|
|
484
|
+
totalAmount1000: 350000000, // Rp 350.000
|
|
485
|
+
totalCurrencyCode: "IDR",
|
|
486
|
+
thumbnail: "https://img.jpg" // Gambar produk terlampir
|
|
487
|
+
});
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
### D. Konversi ID: sock.getPNFromLid & sock.getLidFromPN
|
|
491
|
+
Digunakan untuk menukarkan identitas terenkripsi WhatsApp terbaru (LID ID ke Nomor Telepon asli atau sebaliknya) dalam interaksi grup.
|
|
492
|
+
```javascript
|
|
493
|
+
// Mengambil nomor telepon dari LID akun di grup
|
|
494
|
+
const phoneNumber = await sock.getPNFromLid(m, "123xxxx@lid");
|
|
495
|
+
console.log("Nomor Telepon Asli Pengguna:", phoneNumber);
|
|
496
|
+
```
|
|
497
|
+
```javascript
|
|
498
|
+
// Mengambil LID dari nomor telepon akun di grup
|
|
499
|
+
const lid = await sock.getLidFromPN(m, "62xxxx@s.whatsapp.net");
|
|
500
|
+
console.log("LID Dari Pengguna:", lid);
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
## ⚠️ Ketentuan Penggunaan & Lisensi (Terms of Use)
|
|
504
|
+
1. **Izin Penggunaan:** Anda diberikan izin penuh untuk menggunakan dan memodifikasi library ini untuk proyek pribadi maupun kebutuhan komersial Anda sendiri.
|
|
505
|
+
2. **Larangan Keras:** Dilarang keras mengunggah ulang (*reuploading*), menjual kembali (*reselling*), melisensikan ulang (*relicensing*), atau mendistribusikan pustaka ini sebagai produk mandiri (*standalone product*) tanpa izin tertulis dari **RyuuReinzz**.
|
|
506
|
+
3. **Klaim Hak Cipta:** Dilarang mengklaim proyek orisinal ini sebagai hasil karya murni Anda sendiri. Hormati hak kekayaan intelektual pemilik kode dengan tetap mempertahankan informasi kredit pembuka.
|