Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoSobrino committed Oct 6, 2024
1 parent 4cab746 commit 7993e24
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
18 changes: 9 additions & 9 deletions plugins/buscador-tiktoksearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,26 @@ 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: {
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) {
Expand Down
26 changes: 13 additions & 13 deletions src/libraries/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ END:VCARD
})
})
};
const messageContent = WAE2E.Message.fromObject({
const messageContent = proto.Message.fromObject({
viewOnceMessage: {
message: {
messageContextInfo: {
Expand Down Expand Up @@ -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: ''
}),
Expand All @@ -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({
Expand All @@ -671,7 +671,7 @@ END:VCARD
})
})
});
const messageContent = WAE2E.Message.fromObject({
const messageContent = proto.Message.fromObject({
viewOnceMessage: {
message: {
messageContextInfo: {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)),
Expand Down

0 comments on commit 7993e24

Please sign in to comment.