@ryuu-reinzz/haruka-lib 1.0.13 → 1.0.15
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 +67 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,8 +6,62 @@
|
|
|
6
6
|
<b>Powerful & Lightweight WhatsApp Bot Library Extension</b>
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
# How to use
|
|
10
|
+
``` bash
|
|
11
|
+
npm install @ryuu-reinzz/haruka-lib@1.0.15
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
*how to use it in JavaScript:*
|
|
15
|
+
``` javascript
|
|
16
|
+
import haruka from "@ryuu-reinzz/haruka-lib";
|
|
17
|
+
import makeWASocket, {
|
|
18
|
+
proto,
|
|
19
|
+
generateWAMessageFromContent,
|
|
20
|
+
jidDecode,
|
|
21
|
+
downloadContentFromMessage,
|
|
22
|
+
prepareWAMessageMedia,
|
|
23
|
+
generateMessageID,
|
|
24
|
+
generateWAMessage
|
|
25
|
+
} from '@ryuu-reinzz/baileys';
|
|
26
|
+
|
|
27
|
+
const property = {
|
|
28
|
+
proto,
|
|
29
|
+
generateWAMessageFromContent,
|
|
30
|
+
jidDecode,
|
|
31
|
+
downloadContentFromMessage,
|
|
32
|
+
prepareWAMessageMedia,
|
|
33
|
+
generateMessageID,
|
|
34
|
+
generateWAMessage
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const conn = makeWASocket({});
|
|
38
|
+
haruka.addProperty(conn, store, smsg, property);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 1. Send Button
|
|
42
|
+
*Digunakan untuk mengirim button message ke WhatsApp jika baileys bawaan tidak mendukung*
|
|
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
|
+
});
|
|
59
|
+
```
|
|
60
|
+
Hasil Output:
|
|
61
|
+
<img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendButton.jpg" width="300" />
|
|
62
|
+
|
|
63
|
+
## 2. Send Order
|
|
64
|
+
*Digunakan untuk membuat tampilan pesanan profesional atau sekedar prank orderan.*
|
|
11
65
|
|
|
12
66
|
``` javascript
|
|
13
67
|
conn.sendOrder(m.chat, {
|
|
@@ -26,8 +80,8 @@ conn.sendOrder(m.chat, {
|
|
|
26
80
|
Hasil Output:
|
|
27
81
|
<img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendOrder.jpg" width="300" />
|
|
28
82
|
|
|
29
|
-
##
|
|
30
|
-
|
|
83
|
+
## 3. Send Album
|
|
84
|
+
*Cocok untuk mengirim katalog produk atau galeri foto tanpa memenuhi chat.*
|
|
31
85
|
|
|
32
86
|
``` javascript
|
|
33
87
|
conn.sendAlbum(m.chat, [
|
|
@@ -39,8 +93,8 @@ conn.sendAlbum(m.chat, [
|
|
|
39
93
|
Hasil Output:
|
|
40
94
|
<img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendAlbum.jpg" width="300" />
|
|
41
95
|
|
|
42
|
-
##
|
|
43
|
-
|
|
96
|
+
## 4. Send Card (Carousel)
|
|
97
|
+
*Fitur tercanggih untuk membuat menu bot yang bisa digeser (slide) ke samping.*
|
|
44
98
|
|
|
45
99
|
``` javascript
|
|
46
100
|
conn.sendCard(m.chat, {
|
|
@@ -60,8 +114,8 @@ conn.sendCard(m.chat, {
|
|
|
60
114
|
## Hasil Output:
|
|
61
115
|
<img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendCard.jpg" width="300" />
|
|
62
116
|
|
|
63
|
-
##
|
|
64
|
-
|
|
117
|
+
## 5. Custom Sticker
|
|
118
|
+
*Buat stiker langsung dengan identitas bot kamu sendiri.*
|
|
65
119
|
|
|
66
120
|
``` javascript
|
|
67
121
|
conn.sendSticker(m.chat, {
|
|
@@ -73,8 +127,10 @@ conn.sendSticker(m.chat, {
|
|
|
73
127
|
## Hasil Output:
|
|
74
128
|
<img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendSticker.jpg" width="200" />
|
|
75
129
|
|
|
76
|
-
##
|
|
77
|
-
|
|
130
|
+
## 6. ID Mapping (LID to PN and PN to LID)
|
|
131
|
+
*Mencari LID atau Phone Number*
|
|
132
|
+
|
|
133
|
+
``` javascript
|
|
78
134
|
// Mencari LID dari nomor HP
|
|
79
135
|
await conn.getLidFromPN(m, "6288246552068@s.whatsapp.net");
|
|
80
136
|
|
|
@@ -82,4 +138,4 @@ await conn.getLidFromPN(m, "6288246552068@s.whatsapp.net");
|
|
|
82
138
|
await conn.getPNFromLid(m, "129459441135829@lid");
|
|
83
139
|
```
|
|
84
140
|
### Hasil Output:
|
|
85
|
-
<img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/mapping.jpg" width="300" />
|
|
141
|
+
<img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/mapping.jpg" width="300" />
|