@ryuu-reinzz/haruka-lib 1.0.12 → 1.0.14
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/LICENSE +21 -0
- package/README.md +40 -5
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ryuu-reinzz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -5,8 +5,41 @@
|
|
|
5
5
|
|
|
6
6
|
<b>Powerful & Lightweight WhatsApp Bot Library Extension</b>
|
|
7
7
|
</p>
|
|
8
|
+
|
|
9
|
+
# How to use
|
|
10
|
+
``` bash
|
|
11
|
+
npm install @ryuu-reinzz/haruka-lib@1.0.14
|
|
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
|
+
|
|
8
41
|
## 1. Send Order
|
|
9
|
-
|
|
42
|
+
*Digunakan untuk membuat tampilan pesanan profesional atau sekedar prank orderan.*
|
|
10
43
|
|
|
11
44
|
``` javascript
|
|
12
45
|
conn.sendOrder(m.chat, {
|
|
@@ -26,7 +59,7 @@ Hasil Output:
|
|
|
26
59
|
<img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendOrder.jpg" width="300" />
|
|
27
60
|
|
|
28
61
|
## 2. Send Album
|
|
29
|
-
|
|
62
|
+
*Cocok untuk mengirim katalog produk atau galeri foto tanpa memenuhi chat.*
|
|
30
63
|
|
|
31
64
|
``` javascript
|
|
32
65
|
conn.sendAlbum(m.chat, [
|
|
@@ -39,7 +72,7 @@ Hasil Output:
|
|
|
39
72
|
<img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendAlbum.jpg" width="300" />
|
|
40
73
|
|
|
41
74
|
## 3. Send Card (Carousel)
|
|
42
|
-
|
|
75
|
+
*Fitur tercanggih untuk membuat menu bot yang bisa digeser (slide) ke samping.*
|
|
43
76
|
|
|
44
77
|
``` javascript
|
|
45
78
|
conn.sendCard(m.chat, {
|
|
@@ -60,7 +93,7 @@ conn.sendCard(m.chat, {
|
|
|
60
93
|
<img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendCard.jpg" width="300" />
|
|
61
94
|
|
|
62
95
|
## 4. Custom Sticker
|
|
63
|
-
|
|
96
|
+
*Buat stiker langsung dengan identitas bot kamu sendiri.*
|
|
64
97
|
|
|
65
98
|
``` javascript
|
|
66
99
|
conn.sendSticker(m.chat, {
|
|
@@ -73,7 +106,9 @@ conn.sendSticker(m.chat, {
|
|
|
73
106
|
<img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendSticker.jpg" width="200" />
|
|
74
107
|
|
|
75
108
|
## 5. ID Mapping (LID to PN and PN to LID)
|
|
76
|
-
|
|
109
|
+
*Mencari LID atau Phone Number*
|
|
110
|
+
|
|
111
|
+
``` javascript
|
|
77
112
|
// Mencari LID dari nomor HP
|
|
78
113
|
await conn.getLidFromPN(m, "6288246552068@s.whatsapp.net");
|
|
79
114
|
|