@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 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
- @ryuu-reinzz/haruka-lib │
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 value(jid, items = [], options = {}) {
503
- if (!this.user?.id) {
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: this.user.id,
522
- upload: this.waUploadToServer,
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 this.relayMessage(album.key.remoteJid, album
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: this
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 this.relayMessage(
565
+ return socket.relayMessage(
566
566
  mediaMsg.key.remoteJid,
567
567
  mediaMsg.message, {
568
568
  messageId: mediaMsg
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuu-reinzz/haruka-lib",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Library extra for bot WhatsApp",
5
5
  "main": "main/index.js",
6
6
  "type": "module",