@ryuu-reinzz/baileys 2.0.3-beta.2 → 2.1.4
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 +34 -0
- package/lib/Socket/business.js +6 -6
- package/lib/index.js +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -332,6 +332,40 @@ await RyuuBotz.sendMessage(jid, {
|
|
|
332
332
|
```
|
|
333
333
|
</details>
|
|
334
334
|
|
|
335
|
+
<details>
|
|
336
|
+
<summary><strong>🔥 Sticker Message</strong></summary>
|
|
337
|
+
|
|
338
|
+
```javascript
|
|
339
|
+
// Simple send sticker
|
|
340
|
+
await RyuuBotz.sendSticker(jid, {
|
|
341
|
+
sticker: './your/path', //user path
|
|
342
|
+
packname: "your packname",
|
|
343
|
+
author: "your author"
|
|
344
|
+
}
|
|
345
|
+
);
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
```javascript
|
|
349
|
+
// Simple send sticker
|
|
350
|
+
await RyuuBotz.sendSticker(jid, {
|
|
351
|
+
sticker: { url : "https://your.url.com/image.webp" }, //user url
|
|
352
|
+
packname: "your packname",
|
|
353
|
+
author: "your author"
|
|
354
|
+
}
|
|
355
|
+
);
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
```javascript
|
|
359
|
+
// Simple send sticker
|
|
360
|
+
await RyuuBotz.sendSticker(jid, {
|
|
361
|
+
sticker: fs.readFileSync('sticker.webp'), //use buffer
|
|
362
|
+
packname: "your packname",
|
|
363
|
+
author: "your author"
|
|
364
|
+
}
|
|
365
|
+
);
|
|
366
|
+
```
|
|
367
|
+
</details>
|
|
368
|
+
|
|
335
369
|
<details>
|
|
336
370
|
<summary><strong>💥 React Message</strong></summary>
|
|
337
371
|
|
package/lib/Socket/business.js
CHANGED
|
@@ -8,6 +8,7 @@ const business_1 = require("../Utils/business")
|
|
|
8
8
|
const generic_utils_1 = require("../WABinary/generic-utils")
|
|
9
9
|
const messages_recv_1 = require("./messages-recv")
|
|
10
10
|
const { Sticker } = require('wa-sticker-formatter')
|
|
11
|
+
const path = require('path')
|
|
11
12
|
const fs = require('fs')
|
|
12
13
|
|
|
13
14
|
const makeBusinessSocket = (config) => {
|
|
@@ -18,14 +19,14 @@ sock.sendSticker = async (jid, options = {}) => {
|
|
|
18
19
|
if (!options.sticker)
|
|
19
20
|
throw new Error('Please enter the path or buffer of the sticker.')
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
const tmpDir = path.join(__dirname, './tmp')
|
|
23
|
+
if (!fs.existsSync(tmpDir)) fs.mkdirSync(tmpDir, { recursive: true })
|
|
22
24
|
|
|
23
25
|
let stickerPath
|
|
24
26
|
|
|
25
27
|
if (Buffer.isBuffer(options.sticker)) {
|
|
26
|
-
|
|
27
|
-
fs.writeFileSync(
|
|
28
|
-
stickerPath = tmpPath
|
|
28
|
+
stickerPath = path.join(tmpDir, `sticker_${Date.now()}.webp`)
|
|
29
|
+
fs.writeFileSync(stickerPath, options.sticker)
|
|
29
30
|
} else if (typeof options.sticker === 'string') {
|
|
30
31
|
if (!fs.existsSync(options.sticker))
|
|
31
32
|
throw new Error(`File not found: ${options.sticker}`)
|
|
@@ -45,8 +46,7 @@ sock.sendSticker = async (jid, options = {}) => {
|
|
|
45
46
|
const buffer = await sticker.build()
|
|
46
47
|
const result = await sock.sendMessage(jid, { sticker: buffer })
|
|
47
48
|
|
|
48
|
-
if (Buffer.isBuffer(options.sticker))
|
|
49
|
-
}
|
|
49
|
+
if (Buffer.isBuffer(options.sticker)) fs.unlinkSync(stickerPath)
|
|
50
50
|
|
|
51
51
|
return result
|
|
52
52
|
} catch (e) {
|
package/lib/index.js
CHANGED
|
@@ -8,7 +8,7 @@ console.log(`
|
|
|
8
8
|
\x1b[38;2;135;206;235m╚═╝░░╚═╝░░░╚═╝░░░░╚═════╝░░╚═════╝░\x1b[0m
|
|
9
9
|
\x1b[37mNote: Terimakasih Telah Menggunakan Baileys Ini :v\x1b[0m
|
|
10
10
|
\x1b[90mCopyright © 2024 - 2025 Ryuu\x1b[0m\n\n
|
|
11
|
-
\x1b[37mUpdate: sendSticker (send sticker from video/image/sticker)\x1b[0m
|
|
11
|
+
\x1b[37mUpdate: conn.sendSticker (send sticker from video/image/sticker)\x1b[0m
|
|
12
12
|
`);
|
|
13
13
|
|
|
14
14
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryuu-reinzz/baileys",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"description": "Baileys is a lightweight JavaScript library for interacting with the WhatsApp Web API using WebSocket.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"facebook",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"link-preview-js": "^3.0.14",
|
|
43
43
|
"lru-cache": "^11.1.0",
|
|
44
44
|
"music-metadata": "^7.12.3",
|
|
45
|
+
"path": "^0.12.7",
|
|
45
46
|
"pino": "^9.6",
|
|
46
47
|
"protobufjs": "^7.2.4",
|
|
47
48
|
"qrcode-terminal": "^0.12.0",
|