@ryuu-reinzz/haruka-lib 1.0.14 → 1.1.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 CHANGED
@@ -1,18 +1,21 @@
1
- ### Haruka Library
2
- <p align="center">
3
- <img src="https://api.ryuu-dev.offc.my.id/src/assest/bot/Haruka.jpg" width="400" alt="Haruka-Lib">
1
+ # Package Docs
4
2
 
3
+ **@ryuu-reinzz/haruka-lib**
5
4
 
6
- <b>Powerful & Lightweight WhatsApp Bot Library Extension</b>
7
- </p>
5
+ ![Thumbnail](https://api.ryuu-dev.offc.my.id/src/assest/bot/Haruka.jpg)
8
6
 
9
- # How to use
10
- ``` bash
11
- npm install @ryuu-reinzz/haruka-lib@1.0.14
12
- ```
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
13
18
 
14
- *how to use it in JavaScript:*
15
- ``` javascript
16
19
  import haruka from "@ryuu-reinzz/haruka-lib";
17
20
  import makeWASocket, {
18
21
  proto,
@@ -38,42 +41,67 @@ const conn = makeWASocket({});
38
41
  haruka.addProperty(conn, store, smsg, property);
39
42
  ```
40
43
 
41
- ## 1. Send Order
42
- *Digunakan untuk membuat tampilan pesanan profesional atau sekedar prank orderan.*
43
44
 
45
+
46
+ ---
47
+ ##List Feature
48
+ #1. sendOrder
49
+
50
+ Deskripsi: Mengirim pesan orderan palsu yang bisa bebas thumbnail.
51
+
52
+ Contoh:
44
53
  ``` javascript
45
- conn.sendOrder(m.chat, {
46
- orderId: "ORDER-" + Date.now(),
47
- thumbnail: global.thumbnail,
48
- itemCount: 15,
49
- status: 1,
50
- surface: 1,
51
- orderTitle: "Premium Subscription",
52
- message: "Zahlea botz",
53
- sellerJid: conn.user.jid,
54
- totalAmount1000: 500000000,
55
- totalCurrencyCode: "IDR"
56
- }, { quoted: m, mentions: [m.sender] });
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
+ );
57
73
  ```
58
- Hasil Output:
59
- <img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendOrder.jpg" width="300" />
74
+ Example:
75
+ ![example](https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendOrder.jpg)
76
+
77
+
60
78
 
61
- ## 2. Send Album
62
- *Cocok untuk mengirim katalog produk atau galeri foto tanpa memenuhi chat.*
79
+ ---
63
80
 
81
+ #2. sendAlbum
82
+
83
+ Deskripsi: Mengirim pesan berupa beberapa gambar sekaligus.
84
+
85
+ Contoh:
64
86
  ``` javascript
65
87
  conn.sendAlbum(m.chat, [
66
88
  { image: { url: global.thumbnail }, caption: "Gambar 1" },
67
89
  { image: { url: global.thumbnail }, caption: "Gambar 2" },
68
90
  { image: fs.readFileSync("./image.jpg"), caption: "Stiker lucu" }
69
- ], { quoted: m });
70
- ```
71
- Hasil Output:
72
- <img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendAlbum.jpg" width="300" />
91
+ ], { quoted: m });
92
+ ```
93
+ Example:
94
+ ![example](https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendAlbum.jpg)
73
95
 
74
- ## 3. Send Card (Carousel)
75
- *Fitur tercanggih untuk membuat menu bot yang bisa digeser (slide) ke samping.*
76
96
 
97
+
98
+ ---
99
+
100
+ #3. sendCard
101
+
102
+ Deskripsi: Mengirim pesan seperti kartu dan bisa memiliki button.
103
+
104
+ Contoh:
77
105
  ``` javascript
78
106
  conn.sendCard(m.chat, {
79
107
  text: "Bot Thumbnail",
@@ -84,36 +112,74 @@ conn.sendCard(m.chat, {
84
112
  {
85
113
  image: global.thumbnail,
86
114
  caption: "Thumbnail 1",
87
- buttons: [{ name: "cta_url", buttonParamsJson: JSON.stringify({ display_text: "Visit", url: "https://google.com" }) }]
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
+ ]
88
139
  }
89
140
  ]
90
141
  });
91
142
  ```
92
- ## Hasil Output:
93
- <img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendCard.jpg" width="300" />
143
+ Example:
144
+ ![example](https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendCard.jpg)
145
+
94
146
 
95
- ## 4. Custom Sticker
96
- *Buat stiker langsung dengan identitas bot kamu sendiri.*
147
+ ---
97
148
 
149
+ #4. sendSticker
150
+
151
+ Deskripsi: Mengirim pesan yang bisa bebas custom packname dan author.
152
+
153
+ Contoh:
98
154
  ``` javascript
99
155
  conn.sendSticker(m.chat, {
100
156
  sticker: "./stiker/apa-woi.webp",
101
- packname: "Haruka Bot",
102
- author: "@ryuu-reinzz"
157
+ packname: global.packaname,
158
+ author: global.author
103
159
  });
104
160
  ```
105
- ## Hasil Output:
106
- <img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendSticker.jpg" width="200" />
161
+ Example:
162
+ ![example](https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/sendSticker.jpg)
163
+
107
164
 
108
- ## 5. ID Mapping (LID to PN and PN to LID)
109
- *Mencari LID atau Phone Number*
110
165
 
111
- ``` javascript
112
- // Mencari LID dari nomor HP
113
- await conn.getLidFromPN(m, "6288246552068@s.whatsapp.net");
166
+ ---
114
167
 
115
- // Mencari nomor HP dari LID
116
- await conn.getPNFromLid(m, "129459441135829@lid");
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
+ );
117
183
  ```
118
- ### Hasil Output:
119
- <img src="https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/mapping.jpg" width="300" />
184
+ Example:
185
+ ![example](https://api.ryuu-dev.offc.my.id/src/assest/Haruhime/mapping.jpg)
package/main/index.js CHANGED
@@ -2,8 +2,7 @@ import addProperty from './socket.js';
2
2
  import useSQLiteAuthState from './sqliteAuth.js';
3
3
 
4
4
  const haruka = {}
5
- haruka.tutorial = () => {
6
- console.log(`
5
+ haruka.tutorial = console.log(`
7
6
  ╭──────────────────────────────────────╮
8
7
  │ @ryuu-reinzz/haruka-lib │
9
8
  │ Small helper for WhatsApp Baileys │
@@ -36,7 +35,7 @@ Examples:
36
35
  generateMessageID
37
36
  }
38
37
  import haruka from "@ryuu-reinzz/haruka-lib";
39
- haruka.addProperty(conn, store, smsg, baileys);
38
+ haruka.extendSocketBot(conn, store, smsg, baileys);
40
39
 
41
40
  SQLite session:
42
41
  const sessionPath = "./session"
@@ -45,8 +44,7 @@ Examples:
45
44
  const { state, saveCreds } = await useSQLiteAuthState(sessionPath + \"auth.db\");
46
45
 
47
46
  Made by Ryuu
48
- `)
49
- }
47
+ `);
50
48
  haruka.useSQLiteAuthState = useSQLiteAuthState;
51
49
  haruka.addProperty = addProperty;
52
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuu-reinzz/haruka-lib",
3
- "version": "1.0.14",
3
+ "version": "1.1.0-beta.1",
4
4
  "description": "Library extra for bot WhatsApp",
5
5
  "main": "main/index.js",
6
6
  "type": "module",
package/LICENSE DELETED
@@ -1,21 +0,0 @@
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.