@ryuu-reinzz/haruka-lib 1.0.3 → 1.0.5
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/main/index.js +2 -2
- package/main/socket.js +7 -7
- package/package.json +1 -1
package/main/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import addProperty from './socket.js';
|
|
|
2
2
|
import useSQLiteAuthState from './sqliteAuth.js';
|
|
3
3
|
|
|
4
4
|
const haruka = {}
|
|
5
|
-
console.log(`
|
|
5
|
+
haruka.tutorial = console.log(`
|
|
6
6
|
╭──────────────────────────────────────╮
|
|
7
|
-
│
|
|
7
|
+
│ @ryuu-reinzz/haruka-lib │
|
|
8
8
|
│ Small helper for WhatsApp Baileys │
|
|
9
9
|
╰──────────────────────────────────────╯
|
|
10
10
|
|
package/main/socket.js
CHANGED
|
@@ -499,8 +499,8 @@ Object.assign(socket, {
|
|
|
499
499
|
return msg;
|
|
500
500
|
},
|
|
501
501
|
sendAlbum: {
|
|
502
|
-
async
|
|
503
|
-
if (!
|
|
502
|
+
async (jid, items = [], options = {}) {
|
|
503
|
+
if (!socket.user?.id) {
|
|
504
504
|
throw new Error("User not authenticated");
|
|
505
505
|
}
|
|
506
506
|
|
|
@@ -518,8 +518,8 @@ Object.assign(socket, {
|
|
|
518
518
|
};
|
|
519
519
|
|
|
520
520
|
const generationOptions = {
|
|
521
|
-
userJid:
|
|
522
|
-
upload:
|
|
521
|
+
userJid: socket.user.id,
|
|
522
|
+
upload: socket.waUploadToServer,
|
|
523
523
|
quoted: options?.quoted || null,
|
|
524
524
|
ephemeralExpiration: options?.quoted
|
|
525
525
|
?.expiration ?? 0,
|
|
@@ -528,7 +528,7 @@ Object.assign(socket, {
|
|
|
528
528
|
const album = generateWAMessageFromContent(jid,
|
|
529
529
|
messageContent, generationOptions);
|
|
530
530
|
|
|
531
|
-
await
|
|
531
|
+
await socket.relayMessage(album.key.remoteJid, album
|
|
532
532
|
.message, {
|
|
533
533
|
messageId: album.key.id,
|
|
534
534
|
});
|
|
@@ -544,7 +544,7 @@ Object.assign(socket, {
|
|
|
544
544
|
await generateWAMessage(
|
|
545
545
|
album.key.remoteJid,
|
|
546
546
|
content, {
|
|
547
|
-
upload:
|
|
547
|
+
upload: socket
|
|
548
548
|
.waUploadToServer,
|
|
549
549
|
ephemeralExpiration: options
|
|
550
550
|
?.quoted
|
|
@@ -562,7 +562,7 @@ Object.assign(socket, {
|
|
|
562
562
|
},
|
|
563
563
|
};
|
|
564
564
|
|
|
565
|
-
return
|
|
565
|
+
return socket.relayMessage(
|
|
566
566
|
mediaMsg.key.remoteJid,
|
|
567
567
|
mediaMsg.message, {
|
|
568
568
|
messageId: mediaMsg
|