From 7993e24535ab3ba49c2196bd2e7507579da027c9 Mon Sep 17 00:00:00 2001 From: BrunoSobrino Date: Sat, 5 Oct 2024 20:08:25 -0600 Subject: [PATCH] Fix --- plugins/buscador-tiktoksearch.js | 18 +++++++++--------- src/libraries/simple.js | 26 +++++++++++++------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/plugins/buscador-tiktoksearch.js b/plugins/buscador-tiktoksearch.js index 899d2a8061..af50c2e6da 100644 --- a/plugins/buscador-tiktoksearch.js +++ b/plugins/buscador-tiktoksearch.js @@ -112,14 +112,14 @@ shuffleArray(searchResults) let selectedResults = searchResults.splice(0, 7) for (let result of selectedResults) { results.push({ -body: WAE2E.Message.InteractiveMessage.Body.fromObject({ text: null }), -footer: WAE2E.Message.InteractiveMessage.Footer.fromObject({ text: wm }), -header: WAE2E.Message.InteractiveMessage.Header.fromObject({ +body: proto.Message.InteractiveMessage.Body.fromObject({ text: null }), +footer: proto.Message.InteractiveMessage.Footer.fromObject({ text: wm }), +header: proto.Message.InteractiveMessage.Header.fromObject({ title: '' + result.title, hasMediaAttachment: true, videoMessage: await createVideoMessage(result.nowm) }), -nativeFlowMessage: WAE2E.Message.InteractiveMessage.NativeFlowMessage.fromObject({ buttons: [] })})} +nativeFlowMessage: proto.Message.InteractiveMessage.NativeFlowMessage.fromObject({ buttons: [] })})} const responseMessage = generateWAMessageFromContent(message.chat, { viewOnceMessage: { message: { @@ -127,11 +127,11 @@ messageContextInfo: { deviceListMetadata: {}, deviceListMetadataVersion: 2 }, -interactiveMessage: WAE2E.Message.InteractiveMessage.fromObject({ -body: WAE2E.Message.InteractiveMessage.Body.create({ text: '[❗️] Resultado de: ' + text }), -footer: WAE2E.Message.InteractiveMessage.Footer.create({ text: '🔎 `T I K T O K - S E A R C H`' }), -header: WAE2E.Message.InteractiveMessage.Header.create({ hasMediaAttachment: false }), -carouselMessage: WAE2E.Message.InteractiveMessage.CarouselMessage.fromObject({ cards: [...results] })})}} +interactiveMessage: proto.Message.InteractiveMessage.fromObject({ +body: proto.Message.InteractiveMessage.Body.create({ text: '[❗️] Resultado de: ' + text }), +footer: proto.Message.InteractiveMessage.Footer.create({ text: '🔎 `T I K T O K - S E A R C H`' }), +header: proto.Message.InteractiveMessage.Header.create({ hasMediaAttachment: false }), +carouselMessage: proto.Message.InteractiveMessage.CarouselMessage.fromObject({ cards: [...results] })})}} }, { quoted: message }) await conn.relayMessage(message.chat, responseMessage.message, { messageId: responseMessage.key.id }) } catch (error) { diff --git a/src/libraries/simple.js b/src/libraries/simple.js index 0c328e0052..b1e37161be 100644 --- a/src/libraries/simple.js +++ b/src/libraries/simple.js @@ -449,7 +449,7 @@ END:VCARD }) }) }; - const messageContent = WAE2E.Message.fromObject({ + const messageContent = proto.Message.fromObject({ viewOnceMessage: { message: { messageContextInfo: { @@ -600,20 +600,20 @@ END:VCARD });*/ return { - body: WAE2E.Message.InteractiveMessage.Body.fromObject({ + body: proto.Message.InteractiveMessage.Body.fromObject({ text: text || '' }), - footer: WAE2E.Message.InteractiveMessage.Footer.fromObject({ + footer: proto.Message.InteractiveMessage.Footer.fromObject({ text: footer || wm }), - header: WAE2E.Message.InteractiveMessage.Header.fromObject({ + header: proto.Message.InteractiveMessage.Header.fromObject({ title: text2, subtitle: text || '', hasMediaAttachment: img?.imageMessage || video?.videoMessage ? true : false, imageMessage: img?.imageMessage || null, videoMessage: video?.videoMessage || null }), - nativeFlowMessage: WAE2E.Message.InteractiveMessage.NativeFlowMessage.fromObject({ + nativeFlowMessage: proto.Message.InteractiveMessage.NativeFlowMessage.fromObject({ buttons: dynamicButtons.filter(Boolean), messageParamsJson: '' }), @@ -637,19 +637,19 @@ END:VCARD }) }; })); - const interactiveMessage = WAE2E.Message.InteractiveMessage.create({ - body: WAE2E.Message.InteractiveMessage.Body.fromObject({ + const interactiveMessage = proto.Message.InteractiveMessage.create({ + body: proto.Message.InteractiveMessage.Body.fromObject({ text: text || '' }), - footer: WAE2E.Message.InteractiveMessage.Footer.fromObject({ + footer: proto.Message.InteractiveMessage.Footer.fromObject({ text: footer || wm }), - header: WAE2E.Message.InteractiveMessage.Header.fromObject({ + header: proto.Message.InteractiveMessage.Header.fromObject({ title: text || '', subtitle: text || '', hasMediaAttachment: false }), - carouselMessage: WAE2E.Message.InteractiveMessage.CarouselMessage.fromObject({ + carouselMessage: proto.Message.InteractiveMessage.CarouselMessage.fromObject({ cards, }), ...Object.assign({ @@ -671,7 +671,7 @@ END:VCARD }) }) }); - const messageContent = WAE2E.Message.fromObject({ + const messageContent = proto.Message.fromObject({ viewOnceMessage: { message: { messageContextInfo: { @@ -1142,7 +1142,7 @@ let msg = generateWAMessageFromContent(jid, { if (options.readViewOnce && message.message.viewOnceMessage?.message) { vtype = Object.keys(message.message.viewOnceMessage.message)[0]; delete message.message.viewOnceMessage.message[vtype].viewOnce; - message.message = WAE2E.Message.fromObject( + message.message = proto.Message.fromObject( JSON.parse(JSON.stringify(message.message.viewOnceMessage.message)), ); message.message[vtype].contextInfo = message.message.viewOnceMessage.contextInfo; @@ -1266,7 +1266,7 @@ let msg = generateWAMessageFromContent(jid, { * @param {*} options */ async value(jid, participant, inviteCode, inviteExpiration, groupName = 'unknown subject', caption = 'Invitation to join my WhatsApp group', jpegThumbnail, options = {}) { - const msg = WAE2E.Message.fromObject({ + const msg = proto.Message.fromObject({ groupInviteMessage: proto.GroupInviteMessage.fromObject({ inviteCode, inviteExpiration: parseInt(inviteExpiration) || + new Date(new Date + (3 * 86400000)),