@ryuu-reinzz/haruka-lib 1.0.9 → 1.0.10

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 (2) hide show
  1. package/README.md +185 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,185 @@
1
+ # Package Docs
2
+
3
+ **@ryuu-reinzz/haruka-lib**
4
+
5
+ ![Thumbnail](https://api.ryuu-dev.offc.my.id/src/assest/bot/Haruka.jpg)
6
+
7
+ ---
8
+
9
+ ## Daftar Fitur
10
+
11
+ ### How to Use
12
+ **Deskripsi:** Contoh penggunaan Haruka Library dengan Baileys.
13
+
14
+ **Contoh:**
15
+ ```javascript
16
+ //how to use:
17
+ //npm i @ryuu-reinzz/haruka-lib@1.0.9
18
+
19
+ import haruka from "@ryuu-reinzz/haruka-lib";
20
+ import makeWASocket, {
21
+ proto,
22
+ generateWAMessageFromContent,
23
+ jidDecode,
24
+ downloadContentFromMessage,
25
+ prepareWAMessageMedia,
26
+ generateMessageID,
27
+ generateWAMessage
28
+ } from '@ryuu-reinzz/baileys';
29
+
30
+ const property = {
31
+ proto,
32
+ generateWAMessageFromContent,
33
+ jidDecode,
34
+ downloadContentFromMessage,
35
+ prepareWAMessageMedia,
36
+ generateMessageID,
37
+ generateWAMessage
38
+ };
39
+
40
+ const conn = makeWASocket({});
41
+ haruka.addProperty(conn, store, smsg, property);
42
+ ```
43
+
44
+
45
+
46
+ ---
47
+ ##List Feature
48
+ #1. sendOrder
49
+
50
+ Deskripsi: Mengirim pesan orderan palsu yang bisa bebas thumbnail.
51
+
52
+ Contoh:
53
+ ``` javascript
54
+ conn.sendOrder(
55
+ m.chat,
56
+ {
57
+ orderId: "ORDER-" + Date.now(),
58
+ thumbnail: global.thumbnail,
59
+ itemCount: 15,
60
+ status: 1,
61
+ surface: 1,
62
+ orderTitle: "Premium Subscription",
63
+ message: "Zahlea botz",
64
+ sellerJid: conn.user.jid,
65
+ totalAmount1000: 500000000,
66
+ totalCurrencyCode: "IDR"
67
+ },
68
+ {
69
+ quoted: m,
70
+ mentions: [m.sender]
71
+ }
72
+ );
73
+ ```
74
+ Example:
75
+ ![example](https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendOrder.jpg)
76
+
77
+
78
+
79
+ ---
80
+
81
+ #2. sendAlbum
82
+
83
+ Deskripsi: Mengirim pesan berupa beberapa gambar sekaligus.
84
+
85
+ Contoh:
86
+ ``` javascript
87
+ conn.sendAlbum(m.chat, [
88
+ { image: { url: global.thumbnail }, caption: "Gambar 1" },
89
+ { image: { url: global.thumbnail }, caption: "Gambar 2" },
90
+ { image: fs.readFileSync("./image.jpg"), caption: "Stiker lucu" }
91
+ ], { quoted: m });
92
+ ```
93
+ Example:
94
+ ![example](https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendAlbum.jpg)
95
+
96
+
97
+
98
+ ---
99
+
100
+ #3. sendCard
101
+
102
+ Deskripsi: Mengirim pesan seperti kartu dan bisa memiliki button.
103
+
104
+ Contoh:
105
+ ``` javascript
106
+ conn.sendCard(m.chat, {
107
+ text: "Bot Thumbnail",
108
+ footer: "© Ryuu Reinzz",
109
+ quoted: m,
110
+ sender: m.sender,
111
+ cards: [
112
+ {
113
+ image: global.thumbnail,
114
+ caption: "Thumbnail 1",
115
+ source: global.thumbnail,
116
+ buttons: [
117
+ {
118
+ name: "cta_url",
119
+ buttonParamsJson: JSON.stringify({
120
+ display_text: "Lihat Gambar 1",
121
+ url: global.thumbnail
122
+ })
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ image: global.thumbnail,
128
+ caption: "Thumbnail 2",
129
+ source: global.thumbnail,
130
+ buttons: [
131
+ {
132
+ name: "cta_url",
133
+ buttonParamsJson: JSON.stringify({
134
+ display_text: "Lihat Gambar 2",
135
+ url: global.thumbnail2
136
+ })
137
+ }
138
+ ]
139
+ }
140
+ ]
141
+ });
142
+ ```
143
+ Example:
144
+ ![example](https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendCard.jpg)
145
+
146
+
147
+ ---
148
+
149
+ #4. sendSticker
150
+
151
+ Deskripsi: Mengirim pesan yang bisa bebas custom packname dan author.
152
+
153
+ Contoh:
154
+ ``` javascript
155
+ conn.sendSticker(m.chat, {
156
+ sticker: "./stiker/apa-woi.webp",
157
+ packname: global.packaname,
158
+ author: global.author
159
+ });
160
+ ```
161
+ Example:
162
+ ![example](https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendSticker.jpg)
163
+
164
+
165
+
166
+ ---
167
+
168
+ #5. Search Lid and PN
169
+
170
+ Deskripsi: Mencari Lid dan PN.
171
+
172
+ Contoh:
173
+ ``` javascript
174
+ > conn.getLidFromPN(
175
+ m,
176
+ "6288246552068@s.whatsapp.net"
177
+ );
178
+ or
179
+ > conn.getPNFromLid(
180
+ m,
181
+ "129459441135829@lid"
182
+ );
183
+ ```
184
+ Example:
185
+ ![example](https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/mapping.jpg)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuu-reinzz/haruka-lib",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Library extra for bot WhatsApp",
5
5
  "main": "main/index.js",
6
6
  "type": "module",