@ryuu-reinzz/haruka-lib 1.0.15 → 1.2.15

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
@@ -1,52 +1,7 @@
1
1
  import addProperty from './socket.js';
2
2
  import useSQLiteAuthState from './sqliteAuth.js';
3
3
 
4
- const haruka = {}
5
- haruka.tutorial = () => {
6
- console.log(`
7
- ╭──────────────────────────────────────╮
8
- │ @ryuu-reinzz/haruka-lib │
9
- │ Small helper for WhatsApp Baileys │
10
- ╰──────────────────────────────────────╯
11
-
12
- Usage:
13
- haruka.extendSocketBot(socket, store, smsg, baileys)
14
- → extend socket with helper methods
15
-
16
- haruka.useSQLiteAuthState()
17
- → SQLite-based auth state for your bot
18
-
19
- Examples:
20
- Add socket:
21
- import makeWASocket, {
22
- proto,
23
- generateWAMessageFromContent,
24
- jidDecode,
25
- downloadContentFromMessage,
26
- prepareWAMessageMedia,
27
- generateMessageID
28
- } from "baileys";
29
- const conn = makeWASocket({});
30
- const baileys = {
31
- proto,
32
- generateWAMessageFromContent,
33
- jidDecode,
34
- downloadContentFromMessage,
35
- prepareWAMessageMedia,
36
- generateMessageID
37
- }
38
- import haruka from "@ryuu-reinzz/haruka-lib";
39
- haruka.addProperty(conn, store, smsg, baileys);
40
-
41
- SQLite session:
42
- const sessionPath = "./session"
43
- if (!fs.existsSync(sessionPath)) fs.mkdirSync(sessionPath, { recursive: true });
44
- const useSQLiteAuthState = haruka.useSQLiteAuthState;
45
- const { state, saveCreds } = await useSQLiteAuthState(sessionPath + \"auth.db\");
46
-
47
- Made by Ryuu
48
- `)
49
- }
4
+ const haruka = global.Haruka;
50
5
  haruka.useSQLiteAuthState = useSQLiteAuthState;
51
6
  haruka.addProperty = addProperty;
52
7
 
package/main/socket.js CHANGED
@@ -14,6 +14,70 @@ const __dirname = dirname(__filename);
14
14
  */
15
15
 
16
16
  export default function addProperty(socket, store, smsg, baileys) {
17
+ const tutor = `
18
+ Welcome to @ryuu-reinzz/haruka-lib
19
+ Small helper for WhatsApp Baileys
20
+
21
+ Usage:
22
+ haruka.extendSocketBot(socket, store, smsg, baileys)
23
+ → extend socket with helper methods
24
+
25
+ haruka.useSQLiteAuthState()
26
+ → SQLite-based auth state for your bot
27
+
28
+ Examples:
29
+ Add socket:
30
+ import makeWASocket, {
31
+ proto,
32
+ generateWAMessageFromContent,
33
+ jidDecode,
34
+ downloadContentFromMessage,
35
+ prepareWAMessageMedia,
36
+ generateMessageID
37
+ } from "baileys";
38
+ const conn = makeWASocket({});
39
+ const baileys = {
40
+ proto,
41
+ generateWAMessageFromContent,
42
+ jidDecode,
43
+ downloadContentFromMessage,
44
+ prepareWAMessageMedia,
45
+ generateMessageID
46
+ }
47
+ import haruka from "@ryuu-reinzz/haruka-lib";
48
+ haruka.addProperty(conn, store, smsg, baileys);
49
+
50
+ SQLite session:
51
+ const sessionPath = "./session"
52
+ if (!fs.existsSync(sessionPath)) fs.mkdirSync(sessionPath, { recursive: true });
53
+ const useSQLiteAuthState = haruka.useSQLiteAuthState;
54
+ const { state, saveCreds } = await useSQLiteAuthState(sessionPath + \"auth.db\");
55
+
56
+ Made by Ryuu`;
57
+ global.Haruka = () => {
58
+ socket.sendMessage(
59
+ socket.user.jid,
60
+ {
61
+ text: tutor,
62
+ contextInfo: {
63
+ forwardingScore: 99,
64
+ isForwarded: true,
65
+ forwardedNewsletterMessageInfo: {
66
+ newsletterName: "𝙍͢𝙮𝙪𝙪 𝙍͢𝙚𝙞𝙣𝙯𝙯",
67
+ newsletterJid: "120363419382206255@newsletter"
68
+ },
69
+ externalAdReply: {
70
+ title: "Haruka Tutorial",
71
+ body: "How to use",
72
+ thumbnailUrl: "https://api.ryuu-dev.offc.my.id/src/assest/bot/Haruka.jpg",
73
+ sourceUrl: `https://whatsapp.com/channel/0029Vb49CCWJ93wO2dLDqx14`,
74
+ mediaType: 1,
75
+ renderLargerThumbnail: true,
76
+ },
77
+ },
78
+ }
79
+ );
80
+ }
17
81
  const {
18
82
  proto,
19
83
  generateWAMessageFromContent,
@@ -155,350 +219,316 @@ Object.assign(socket, {
155
219
  }
156
220
  },
157
221
 
158
- sendButton: async (jid, content = {}, options = {}) => {
159
- if (!socket.user?.id) {
160
- throw new Error("User not authenticated");
161
- }
162
-
163
- const {
164
- text = "",
165
- caption = "",
166
- title = "",
167
- footer = "",
168
- buttons = [],
169
- hasMediaAttachment = false,
170
- image = null,
171
- video = null,
172
- document = null,
173
- mimetype = null,
174
- jpegThumbnail = null,
175
- location = null,
176
- product = null,
177
- businessOwnerJid = null,
178
- } = content;
179
-
180
- if (!Array.isArray(buttons) || buttons.length ===
181
- 0) {
182
- throw new Error(
183
- "buttons must be a non-empty array");
184
- }
185
-
186
- const interactiveButtons = [];
187
-
188
- for (let i = 0; i < buttons.length; i++) {
189
- const btn = buttons[i];
190
-
191
- if (!btn || typeof btn !== "object") {
192
- throw new Error(
193
- `button[${i}] must be an object`);
194
- }
195
-
196
- if (btn.name && btn.buttonParamsJson) {
197
- interactiveButtons.push(btn);
198
- continue;
199
- }
200
-
201
- if (btn.id || btn.text || btn.displayText) {
202
- interactiveButtons.push({
203
- name: "quick_reply",
204
- buttonParamsJson: JSON
205
- .stringify({
206
- display_text: btn
207
- .text || btn
208
- .displayText ||
209
- `Button ${i + 1}`,
210
- id: btn.id ||
211
- `quick_${i + 1}`,
212
- }),
213
- });
214
- continue;
215
- }
222
+ sendButton:
223
+ async (jid, content = {}, options = {}) => {
224
+ if (!socket.user?.id) {
225
+ throw new Error("User not authenticated");
226
+ }
216
227
 
217
- if (btn.buttonId && btn.buttonText
218
- ?.displayText) {
219
- interactiveButtons.push({
220
- name: "quick_reply",
221
- buttonParamsJson: JSON
222
- .stringify({
223
- display_text: btn
224
- .buttonText
225
- .displayText,
226
- id: btn.buttonId,
227
- }),
228
- });
229
- continue;
230
- }
228
+ const {
229
+ text = "",
230
+ caption = "",
231
+ title = "",
232
+ footer = "",
233
+ buttons = [],
234
+ hasMediaAttachment = false,
235
+ image = null,
236
+ video = null,
237
+ document = null,
238
+ mimetype = null,
239
+ jpegThumbnail = null,
240
+ location = null,
241
+ product = null,
242
+ businessOwnerJid = null,
243
+ externalAdReply = null,
244
+ } = content;
245
+
246
+ if (!Array.isArray(buttons) || buttons.length === 0) {
247
+ throw new Error("buttons must be a non-empty array");
248
+ }
231
249
 
232
- throw new Error(
233
- `button[${i}] has invalid shape`);
234
- }
250
+ const processedButtons = [];
251
+
252
+ for (let i = 0; i < buttons.length; i++) {
253
+ const btn = buttons[i];
254
+
255
+ if (!btn || typeof btn !== "object") {
256
+ throw new Error(`interactiveButton[${i}] must be an object`);
257
+ }
258
+
259
+ if (btn.name && btn.buttonParamsJson) {
260
+ processedButtons.push(btn);
261
+ continue;
262
+ }
263
+
264
+ if (btn.id || btn.text || btn.displayText) {
265
+ processedButtons.push({
266
+ name: "quick_reply",
267
+ buttonParamsJson: JSON.stringify({
268
+ display_text: btn.text || btn.displayText || `Button ${i + 1}`,
269
+ id: btn.id || `quick_${i + 1}`,
270
+ }),
271
+ });
272
+ continue;
273
+ }
274
+
275
+ if (btn.buttonId && btn.buttonText?.displayText) {
276
+ processedButtons.push({
277
+ name: "quick_reply",
278
+ buttonParamsJson: JSON.stringify({
279
+ display_text: btn.buttonText.displayText,
280
+ id: btn.buttonId,
281
+ }),
282
+ });
283
+ continue;
284
+ }
285
+
286
+ throw new Error(`interactiveButton[${i}] has invalid shape`);
287
+ }
235
288
 
236
- let messageContent = {};
237
- if (image) {
238
- const mediaInput = {};
239
- if (Buffer.isBuffer(image)) {
240
- mediaInput.image = image;
241
- } else if (typeof image === "object" && image
242
- .url) {
243
- mediaInput.image = {
244
- url: image.url
245
- };
246
- } else if (typeof image === "string") {
247
- mediaInput.image = {
248
- url: image
249
- };
250
- }
289
+ let messageContent = {};
251
290
 
252
- const preparedMedia =
253
- await prepareWAMessageMedia(mediaInput, {
254
- upload: socket.waUploadToServer,
255
- });
256
-
257
- messageContent.header = {
258
- title: title || "",
259
- hasMediaAttachment: hasMediaAttachment,
260
- imageMessage: preparedMedia
261
- .imageMessage,
262
- };
263
- } else if (video) {
264
- const mediaInput = {};
265
- if (Buffer.isBuffer(video)) {
266
- mediaInput.video = video;
267
- } else if (typeof video === "object" && video
268
- .url) {
269
- mediaInput.video = {
270
- url: video.url
271
- };
272
- } else if (typeof video === "string") {
273
- mediaInput.video = {
274
- url: video
275
- };
276
- }
291
+ if (image) {
292
+ const mediaInput = {};
293
+ if (Buffer.isBuffer(image)) {
294
+ mediaInput.image = image;
295
+ } else if (typeof image === "object" && image.url) {
296
+ mediaInput.image = { url: image.url };
297
+ } else if (typeof image === "string") {
298
+ mediaInput.image = { url: image };
299
+ }
277
300
 
278
- const preparedMedia =
279
- await prepareWAMessageMedia(mediaInput, {
280
- upload: socket.waUploadToServer,
281
- });
282
-
283
- messageContent.header = {
284
- title: title || "",
285
- hasMediaAttachment: hasMediaAttachment,
286
- videoMessage: preparedMedia
287
- .videoMessage,
288
- };
289
- } else if (document) {
290
- const mediaInput = {
291
- document: {}
292
- };
293
-
294
- if (Buffer.isBuffer(document)) {
295
- mediaInput.document = document;
296
- } else if (typeof document === "object" &&
297
- document.url) {
298
- mediaInput.document = {
299
- url: document.url
300
- };
301
- } else if (typeof document === "string") {
302
- mediaInput.document = {
303
- url: document
304
- };
305
- }
301
+ const preparedMedia = await prepareWAMessageMedia(mediaInput, {
302
+ upload: socket.waUploadToServer,
303
+ });
306
304
 
307
- if (mimetype) {
308
- if (typeof mediaInput.document ===
309
- "object") {
310
- mediaInput.document.mimetype = mimetype;
311
- }
312
- }
305
+ messageContent.header = {
306
+ title: title || "",
307
+ hasMediaAttachment: hasMediaAttachment || true,
308
+ imageMessage: preparedMedia.imageMessage,
309
+ };
310
+ } else if (video) {
311
+ const mediaInput = {};
312
+ if (Buffer.isBuffer(video)) {
313
+ mediaInput.video = video;
314
+ } else if (typeof video === "object" && video.url) {
315
+ mediaInput.video = { url: video.url };
316
+ } else if (typeof video === "string") {
317
+ mediaInput.video = { url: video };
318
+ }
319
+
320
+ const preparedMedia = await prepareWAMessageMedia(mediaInput, {
321
+ upload: socket.waUploadToServer,
322
+ });
313
323
 
314
- if (jpegThumbnail) {
315
- if (typeof mediaInput.document ===
316
- "object") {
317
- if (Buffer.isBuffer(jpegThumbnail)) {
318
- mediaInput.document.jpegThumbnail =
319
- jpegThumbnail;
320
- } else if (typeof jpegThumbnail ===
321
- "string") {
322
- try {
323
- const response = await fetch(
324
- jpegThumbnail);
325
- const arrayBuffer =
326
- await response
327
- .arrayBuffer();
328
- mediaInput.document
329
- .jpegThumbnail = Buffer
330
- .from(arrayBuffer);
331
- } catch {
332
- }
333
- }
334
- }
335
- }
324
+ messageContent.header = {
325
+ title: title || "",
326
+ hasMediaAttachment: hasMediaAttachment || true,
327
+ videoMessage: preparedMedia.videoMessage,
328
+ };
329
+ } else if (document) {
330
+ const mediaInput = { document: {} };
331
+
332
+ if (Buffer.isBuffer(document)) {
333
+ mediaInput.document = document;
334
+ } else if (typeof document === "object" && document.url) {
335
+ mediaInput.document = { url: document.url };
336
+ } else if (typeof document === "string") {
337
+ mediaInput.document = { url: document };
338
+ }
339
+
340
+ if (mimetype) {
341
+ if (typeof mediaInput.document === "object") {
342
+ mediaInput.document.mimetype = mimetype;
343
+ }
344
+ }
345
+
346
+ if (jpegThumbnail) {
347
+ if (typeof mediaInput.document === "object") {
348
+ if (Buffer.isBuffer(jpegThumbnail)) {
349
+ mediaInput.document.jpegThumbnail = jpegThumbnail;
350
+ } else if (typeof jpegThumbnail === "string") {
351
+ try {
352
+ const response = await fetch(jpegThumbnail);
353
+ const arrayBuffer = await response.arrayBuffer();
354
+ mediaInput.document.jpegThumbnail = Buffer.from(arrayBuffer);
355
+ } catch {
356
+ //
357
+ }
358
+ }
359
+ }
360
+ }
361
+
362
+ const preparedMedia = await prepareWAMessageMedia(mediaInput, {
363
+ upload: socket.waUploadToServer,
364
+ });
336
365
 
337
- const preparedMedia =
338
- await prepareWAMessageMedia(mediaInput, {
339
- upload: socket.waUploadToServer,
340
- });
341
-
342
- messageContent.header = {
343
- title: title || "",
344
- hasMediaAttachment: hasMediaAttachment,
345
- documentMessage: preparedMedia
346
- .documentMessage,
347
- };
348
- } else if (location && typeof location ===
349
- "object") {
350
- messageContent.header = {
351
- title: title || location.name ||
352
- "Location",
353
- hasMediaAttachment: hasMediaAttachment,
354
- locationMessage: {
355
- degreesLatitude: location
356
- .degressLatitude || location
357
- .degreesLatitude || 0,
358
- degreesLongitude: location
359
- .degressLongitude || location
360
- .degreesLongitude || 0,
361
- name: location.name || "",
362
- address: location.address || "",
363
- },
364
- };
365
- } else if (product && typeof product === "object") {
366
- let productImageMessage = null;
367
- if (product.productImage) {
368
- const mediaInput = {};
369
- if (Buffer.isBuffer(product.productImage)) {
370
- mediaInput.image = product.productImage;
371
- } else if (
372
- typeof product.productImage ===
373
- "object" &&
374
- product.productImage.url
375
- ) {
376
- mediaInput.image = {
377
- url: product.productImage.url,
378
- };
379
- } else if (typeof product.productImage ===
380
- "string") {
381
- mediaInput.image = {
382
- url: product.productImage,
383
- };
384
- }
366
+ messageContent.header = {
367
+ title: title || "",
368
+ hasMediaAttachment: hasMediaAttachment || true,
369
+ documentMessage: preparedMedia.documentMessage,
370
+ };
371
+ } else if (location && typeof location === "object") {
372
+ messageContent.header = {
373
+ title: title || location.name || "Location",
374
+ hasMediaAttachment: hasMediaAttachment || false,
375
+ locationMessage: {
376
+ degreesLatitude:
377
+ location.degressLatitude || location.degreesLatitude || 0,
378
+ degreesLongitude:
379
+ location.degressLongitude || location.degreesLongitude || 0,
380
+ name: location.name || "",
381
+ address: location.address || "",
382
+ },
383
+ };
384
+ } else if (product && typeof product === "object") {
385
+ let productImageMessage = null;
386
+ if (product.productImage) {
387
+ const mediaInput = {};
388
+ if (Buffer.isBuffer(product.productImage)) {
389
+ mediaInput.image = product.productImage;
390
+ } else if (
391
+ typeof product.productImage === "object" &&
392
+ product.productImage.url
393
+ ) {
394
+ mediaInput.image = {
395
+ url: product.productImage.url,
396
+ };
397
+ } else if (typeof product.productImage === "string") {
398
+ mediaInput.image = {
399
+ url: product.productImage,
400
+ };
401
+ }
402
+
403
+ const preparedMedia = await prepareWAMessageMedia(mediaInput, {
404
+ upload: socket.waUploadToServer,
405
+ });
406
+ productImageMessage = preparedMedia.imageMessage;
407
+ }
408
+
409
+ messageContent.header = {
410
+ title: title || product.title || "Product",
411
+ hasMediaAttachment: hasMediaAttachment || false,
412
+ productMessage: {
413
+ product: {
414
+ productImage: productImageMessage,
415
+ productId: product.productId || "",
416
+ title: product.title || "",
417
+ description: product.description || "",
418
+ currencyCode: product.currencyCode || "USD",
419
+ priceAmount1000: parseInt(product.priceAmount1000) || 0,
420
+ retailerId: product.retailerId || "",
421
+ url: product.url || "",
422
+ productImageCount: product.productImageCount || 1,
423
+ },
424
+ businessOwnerJid:
425
+ businessOwnerJid || product.businessOwnerJid || socket.user.id,
426
+ },
427
+ };
428
+ } else if (title) {
429
+ messageContent.header = {
430
+ title: title,
431
+ hasMediaAttachment: false,
432
+ };
433
+ }
385
434
 
386
- const preparedMedia =
387
- await prepareWAMessageMedia(
388
- mediaInput, {
389
- upload: socket.waUploadToServer,
390
- });
391
- productImageMessage = preparedMedia
392
- .imageMessage;
393
- }
435
+ const hasMedia = !!(image || video || document || location || product);
436
+ const bodyText = hasMedia ? caption : text || caption;
394
437
 
395
- messageContent.header = {
396
- title: title || product.title ||
397
- "Product",
398
- hasMediaAttachment: hasMediaAttachment,
399
- productMessage: {
400
- product: {
401
- productImage: productImageMessage,
402
- productId: product.productId ||
403
- "",
404
- title: product.title || "",
405
- description: product
406
- .description || "",
407
- currencyCode: product
408
- .currencyCode || "USD",
409
- priceAmount1000: parseInt(
410
- product.priceAmount1000
411
- ) || 0,
412
- retailerId: product
413
- .retailerId || "",
414
- url: product.url || "",
415
- productImageCount: product
416
- .productImageCount || 1,
417
- },
418
- businessOwnerJid: businessOwnerJid ||
419
- product.businessOwnerJid || socket
420
- .user.id,
421
- },
422
- };
423
- } else if (title) {
424
- messageContent.header = {
425
- title: title,
426
- hasMediaAttachment: false,
427
- };
428
- }
438
+ if (bodyText) {
439
+ messageContent.body = { text: bodyText };
440
+ }
429
441
 
430
- const hasMedia = !!(image || video || document ||
431
- location || product);
432
- const bodyText = hasMedia ? caption : text ||
433
- caption;
442
+ if (footer) {
443
+ messageContent.footer = { text: footer };
444
+ }
434
445
 
435
- if (bodyText) {
436
- messageContent.body = {
437
- text: bodyText
438
- };
439
- }
446
+ messageContent.nativeFlowMessage = {
447
+ buttons: processedButtons,
448
+ };
440
449
 
441
- if (footer) {
442
- messageContent.footer = {
443
- text: footer
444
- };
445
- }
450
+ if (externalAdReply && typeof externalAdReply === "object") {
451
+ messageContent.contextInfo = {
452
+ externalAdReply: {
453
+ title: externalAdReply.title || "",
454
+ body: externalAdReply.body || "",
455
+ mediaType: externalAdReply.mediaType || 1,
456
+ sourceUrl: externalAdReply.sourceUrl || externalAdReply.url || "",
457
+ thumbnailUrl:
458
+ externalAdReply.thumbnailUrl || externalAdReply.thumbnail || "",
459
+ renderLargerThumbnail: externalAdReply.renderLargerThumbnail || false,
460
+ showAdAttribution: externalAdReply.showAdAttribution !== false,
461
+ containsAutoReply: externalAdReply.containsAutoReply || false,
462
+ ...(externalAdReply.mediaUrl && {
463
+ mediaUrl: externalAdReply.mediaUrl,
464
+ }),
465
+ ...(externalAdReply.thumbnail &&
466
+ Buffer.isBuffer(externalAdReply.thumbnail) && {
467
+ thumbnail: externalAdReply.thumbnail,
468
+ }),
469
+ ...(externalAdReply.jpegThumbnail && {
470
+ jpegThumbnail: externalAdReply.jpegThumbnail,
471
+ }),
472
+ },
473
+ ...(options.mentionedJid && {
474
+ mentionedJid: options.mentionedJid,
475
+ }),
476
+ };
477
+ } else if (options.mentionedJid) {
478
+ messageContent.contextInfo = {
479
+ mentionedJid: options.mentionedJid,
480
+ };
481
+ }
446
482
 
447
- messageContent.nativeFlowMessage = {
448
- buttons: interactiveButtons,
449
- };
483
+ const payload = proto.Message.InteractiveMessage.create(messageContent);
450
484
 
451
- const payload = proto.Message.InteractiveMessage
452
- .create(messageContent);
485
+ const msg = generateWAMessageFromContent(
486
+ jid,
487
+ {
488
+ viewOnceMessage: {
489
+ message: {
490
+ interactiveMessage: payload,
491
+ },
492
+ },
493
+ },
494
+ {
495
+ userJid: socket.user.id,
496
+ quoted: options?.quoted || null,
497
+ }
498
+ );
453
499
 
454
- const msg = generateWAMessageFromContent(
455
- jid, {
456
- viewOnceMessage: {
457
- message: {
458
- interactiveMessage: payload,
459
- },
460
- },
461
- }, {
462
- userJid: socket.user.id,
463
- quoted: options?.quoted || null,
464
- }
465
- );
466
- const isGroup = jid.endsWith("@g.us");
467
- const additionalNodes = [{
468
- tag: "biz",
469
- attrs: {},
470
- content: [{
471
- tag: "interactive",
472
- attrs: {
473
- type: "native_flow",
474
- v: "1",
475
- },
476
- content: [{
477
- tag: "native_flow",
478
- attrs: {
479
- v: "9",
480
- name: "mixed",
481
- },
482
- }, ],
483
- }, ],
484
- }, ];
485
-
486
- if (!isGroup) {
487
- additionalNodes.push({
488
- tag: "bot",
489
- attrs: {
490
- biz_bot: "1"
491
- },
492
- });
493
- }
500
+ const additionalNodes = [
501
+ {
502
+ tag: "biz",
503
+ attrs: {},
504
+ content: [
505
+ {
506
+ tag: "interactive",
507
+ attrs: {
508
+ type: "native_flow",
509
+ v: "1",
510
+ },
511
+ content: [
512
+ {
513
+ tag: "native_flow",
514
+ attrs: {
515
+ v: "9",
516
+ name: "mixed",
517
+ },
518
+ },
519
+ ],
520
+ },
521
+ ],
522
+ },
523
+ ];
494
524
 
495
- await socket.relayMessage(jid, msg.message, {
496
- messageId: msg.key.id,
497
- additionalNodes,
498
- });
525
+ await socket.relayMessage(jid, msg.message, {
526
+ messageId: msg.key.id,
527
+ additionalNodes,
528
+ });
499
529
 
500
- return msg;
501
- },
530
+ return msg;
531
+ },
502
532
  sendAlbum: async (jid, items = [], options = {}) => {
503
533
  if (!socket.user?.id) {
504
534
  throw new Error("User not authenticated");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuu-reinzz/haruka-lib",
3
- "version": "1.0.15",
3
+ "version": "1.2.15",
4
4
  "description": "Library extra for bot WhatsApp",
5
5
  "main": "main/index.js",
6
6
  "type": "module",
@@ -17,6 +17,6 @@
17
17
  "dependencies": {
18
18
  "better-sqlite3": "^12.5.0",
19
19
  "node-fetch": "^2.6.1",
20
- "wa-sticker-formatter": "^4.4.4"
20
+ "wa-sticker-formatter": "4.4.4"
21
21
  }
22
22
  }