@nuiisweety/baileys 0.1.8 → 0.1.10
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 +229 -58
- package/README.md.bak +229 -58
- package/README.md.original +1950 -0
- package/lib/Utils/rich-message-utils.js +8 -6
- package/lib/Utils/rich-message-utils.js.original +1323 -0
- package/package.json +1 -1
|
@@ -598,8 +598,13 @@ const makeVideoSub = (videoUrl) => {
|
|
|
598
598
|
});
|
|
599
599
|
return {
|
|
600
600
|
sub: {
|
|
601
|
-
messageType: RichSubMessageType.
|
|
602
|
-
|
|
601
|
+
messageType: RichSubMessageType.DYNAMIC,
|
|
602
|
+
dynamicMetadata: {
|
|
603
|
+
type: 1,
|
|
604
|
+
version: 1,
|
|
605
|
+
url: parsed[0]?.url || '',
|
|
606
|
+
loopCount: 0
|
|
607
|
+
}
|
|
603
608
|
},
|
|
604
609
|
sections: parsed.map(({ url, duration }) => ({
|
|
605
610
|
view_model: {
|
|
@@ -887,7 +892,6 @@ export const prepareRichResponseMessage = (content) => {
|
|
|
887
892
|
contextInfo: {
|
|
888
893
|
isForwarded: true,
|
|
889
894
|
forwardingScore: 1,
|
|
890
|
-
forwardedAiBotMessageInfo: { botJid: '867051314767696@bot' },
|
|
891
895
|
forwardOrigin: 4
|
|
892
896
|
}
|
|
893
897
|
});
|
|
@@ -955,7 +959,6 @@ const buildRichContextInfo = (quoted) => {
|
|
|
955
959
|
const ctxInfo = {
|
|
956
960
|
isForwarded: true,
|
|
957
961
|
forwardingScore: 1,
|
|
958
|
-
forwardedAiBotMessageInfo: { botJid: '867051314767696@bot' },
|
|
959
962
|
forwardOrigin: 4,
|
|
960
963
|
};
|
|
961
964
|
if (quoted?.key) {
|
|
@@ -1104,7 +1107,7 @@ export const captureUnifiedResponse = (msg) => {
|
|
|
1104
1107
|
// ── Link ──────────────────────────────────────────────────
|
|
1105
1108
|
|
|
1106
1109
|
export const generateLinkContent = (text, links, quoted, options = {}) => {
|
|
1107
|
-
const { footer,
|
|
1110
|
+
const { footer, forwardingScore = 3, citations = [], proofs = [] } = options;
|
|
1108
1111
|
const subs = [];
|
|
1109
1112
|
const fullText = footer ? `${text}${footer}` : text;
|
|
1110
1113
|
subs.push({ messageType: RichSubMessageType.TEXT, messageText: fullText });
|
|
@@ -1120,7 +1123,6 @@ export const generateLinkContent = (text, links, quoted, options = {}) => {
|
|
|
1120
1123
|
const base64Data = Buffer.from(JSON.stringify({ response_id: randomUUID(), sections })).toString('base64');
|
|
1121
1124
|
const ctxInfo = buildRichContextInfo(quoted);
|
|
1122
1125
|
ctxInfo.forwardingScore = forwardingScore;
|
|
1123
|
-
ctxInfo.forwardedAiBotMessageInfo = { botJid };
|
|
1124
1126
|
ctxInfo.botMessageSharingInfo = { forwardScore: forwardingScore };
|
|
1125
1127
|
const messageContextInfo = { messageSecret: randomBytes(32) };
|
|
1126
1128
|
if (citations.length > 0 || proofs.length > 0) {
|