Skip to content

Instantly share code, notes, and snippets.

@A-d-i-t-h-y-a-n
Created August 5, 2022 17:15
Show Gist options
  • Save A-d-i-t-h-y-a-n/80d7f0cdcac78294d4e8164a74d9d28c to your computer and use it in GitHub Desktop.
Save A-d-i-t-h-y-a-n/80d7f0cdcac78294d4e8164a74d9d28c to your computer and use it in GitHub Desktop.
const {
Function,
parsedJid,
getBuffer
} = require("../lib/");
const {BOT_INFO} = require('../config')
Function({
pattern: 'mf ?(.*)',
fromMe: true,
type: 'misc'
}, async (m, text, client) => {
if (!m.reply_message) return await m.reply('*Reply to a message*')
if (!text) return await m.reply('*Give me a jid*\nExample .mforward jid1 jid2 jid3 jid4 ...')
const image1 = await getBuffer(BOT_INFO.split(";")[3])
const image2 = await getBuffer(BOT_INFO.split(";")[3])
const options = {}
options.contextInfo = {
forwardingScore: 5, // change it to 999 for many times forwarded
isForwarded: false,
}
options.linkPreview = {
title: BOT_INFO.split(";")[0],
body: BOT_INFO.split(";")[1],
mediaType: 2,
thumbnail: image2,
mediaUrl: '', // insta link for video
sourceUrl: `https://wa.me/${BOT_INFO.split(";")[2]}`,
showAdAttribution: true
}
options.filesize = 9999999999999;
options.quoted = {
key: {
fromMe: false,
participant: '0@s.whatsapp.net',
remoteJid: 'status@broadcast',
},
message: {
imageMessage: {
jpegThumbnail: image2,
caption: `${BOT_INFO.split(";")[1]} ๐™ธ๐š‚ ๐™ผ๐šˆ ๐™พ๐š†๐™ฝ๐™ด๐š`,
},
},
}
if (/audio/.test(m.mine)) {
options.duration = 2000001355
options.ptt = true // delete this if not need audio as voice always
}
for (let jid of parsedJid(text)) {
await client.forwardMessage(jid, m.quoted_message, options)
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment