@nuiisweety/baileys 0.1.5 → 0.1.6

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.
@@ -568,13 +568,13 @@ export const generateWAMessageContent = async (message, options) => {
568
568
  hasNonNullishProperty(message, 'dynamic') ||
569
569
  hasNonNullishProperty(message, 'map') ||
570
570
  hasNonNullishProperty(message, 'contentItems') ||
571
- // tipe baru
572
- hasNonNullishProperty(message, 'image') ||
573
- hasNonNullishProperty(message, 'video') ||
571
+ // tipe baru (nama prefixed 'rich' agar tidak konflik dengan media biasa)
572
+ hasNonNullishProperty(message, 'richImage') ||
573
+ hasNonNullishProperty(message, 'richVideo') ||
574
574
  hasNonNullishProperty(message, 'reels') ||
575
575
  hasNonNullishProperty(message, 'source') ||
576
- hasNonNullishProperty(message, 'product') ||
577
- hasNonNullishProperty(message, 'post') ||
576
+ hasNonNullishProperty(message, 'richProduct') ||
577
+ hasNonNullishProperty(message, 'richPost') ||
578
578
  hasNonNullishProperty(message, 'tip') ||
579
579
  hasNonNullishProperty(message, 'suggest')) {
580
580
  m = prepareRichResponseMessage(message);
@@ -770,8 +770,8 @@ export const prepareRichResponseMessage = (content) => {
770
770
  // sub-types lama
771
771
  gridImage, inlineImage, dynamic: dynamicContent,
772
772
  map: mapContent, latex, contentItems,
773
- // sub-types baru
774
- image, video, reels, source, product, post, tip, suggest
773
+ // sub-types baru (prefixed 'rich' agar tidak konflik dengan media biasa)
774
+ richImage, richVideo, reels, source, richProduct, richPost, tip, suggest
775
775
  } = content;
776
776
 
777
777
  let submessages = [];
@@ -805,14 +805,14 @@ export const prepareRichResponseMessage = (content) => {
805
805
  if (sub.latex != null) { submessages.push(makeLatexSub(sub.latex.text, sub.latex.expressions)); return; }
806
806
  if (sub.contentItems != null) { submessages.push(makeContentItemsSub(sub.contentItems.items, sub.contentItems.contentType)); return; }
807
807
  // tipe baru
808
- if (sub.image != null) { pushRich(makeImageSub(sub.image)); return; }
809
- if (sub.video != null) { pushRich(makeVideoSub(sub.video)); return; }
810
- if (sub.reels != null) { pushRich(makeReelsSub(sub.reels)); return; }
811
- if (sub.source != null) { if (!extraSections) extraSections = []; extraSections.push(makeSourceSection(sub.source)); return; }
812
- if (sub.product != null) { pushRich(makeProductSection(sub.product)); return; }
813
- if (sub.post != null) { pushRich(makePostSection(sub.post)); return; }
814
- if (sub.tip != null) { pushRich(makeTipSub(sub.tip)); return; }
815
- if (sub.suggest != null) { if (!extraSections) extraSections = []; extraSections.push(makeSuggestSection(sub.suggest)); return; }
808
+ if (sub.richImage != null) { pushRich(makeImageSub(sub.richImage)); return; }
809
+ if (sub.richVideo != null) { pushRich(makeVideoSub(sub.richVideo)); return; }
810
+ if (sub.reels != null) { pushRich(makeReelsSub(sub.reels)); return; }
811
+ if (sub.source != null) { if (!extraSections) extraSections = []; extraSections.push(makeSourceSection(sub.source)); return; }
812
+ if (sub.richProduct != null) { pushRich(makeProductSection(sub.richProduct)); return; }
813
+ if (sub.richPost != null) { pushRich(makePostSection(sub.richPost)); return; }
814
+ if (sub.tip != null) { pushRich(makeTipSub(sub.tip)); return; }
815
+ if (sub.suggest != null) { if (!extraSections) extraSections = []; extraSections.push(makeSuggestSection(sub.suggest)); return; }
816
816
  submessages.push(sub); // passthrough kalau sudah bentuk proto
817
817
  });
818
818
  if (footerText) submessages.push(makeTextSub(footerText));
@@ -832,14 +832,14 @@ export const prepareRichResponseMessage = (content) => {
832
832
  if (contentItems) submessages.push(makeContentItemsSub(contentItems.items, contentItems.contentType));
833
833
 
834
834
  // ── tipe baru ──
835
- if (image) pushRich(makeImageSub(image));
836
- if (video) pushRich(makeVideoSub(video));
837
- if (reels) pushRich(makeReelsSub(reels));
838
- if (source) { if (!extraSections) extraSections = []; extraSections.push(makeSourceSection(source)); }
839
- if (product) pushRich(makeProductSection(product));
840
- if (post) pushRich(makePostSection(post));
841
- if (tip) pushRich(makeTipSub(tip));
842
- if (suggest) { if (!extraSections) extraSections = []; extraSections.push(makeSuggestSection(suggest)); }
835
+ if (richImage) pushRich(makeImageSub(richImage));
836
+ if (richVideo) pushRich(makeVideoSub(richVideo));
837
+ if (reels) pushRich(makeReelsSub(reels));
838
+ if (source) { if (!extraSections) extraSections = []; extraSections.push(makeSourceSection(source)); }
839
+ if (richProduct) pushRich(makeProductSection(richProduct));
840
+ if (richPost) pushRich(makePostSection(richPost));
841
+ if (tip) pushRich(makeTipSub(tip));
842
+ if (suggest) { if (!extraSections) extraSections = []; extraSections.push(makeSuggestSection(suggest)); }
843
843
 
844
844
  /* links — bisa dikombinasi dengan tipe lain di atas */
845
845
  if (links && Array.isArray(links)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuiisweety/baileys",
3
3
  "type": "module",
4
- "version": "0.1.5",
4
+ "version": "0.1.6",
5
5
  "description": "A WebSockets library for interacting with WhatsApp Web — forked STRICTLY from @whiskeysockets/baileys only, NOT from any other baileys fork. Modified by NuiiSweety.",
6
6
  "keywords": [
7
7
  "whatsapp",