Skip to content

Instantly share code, notes, and snippets.

@A-d-i-t-h-y-a-n
Last active October 5, 2022 05:44
Show Gist options
  • Save A-d-i-t-h-y-a-n/5dca34cf3401af3a6f12e40964b47685 to your computer and use it in GitHub Desktop.
Save A-d-i-t-h-y-a-n/5dca34cf3401af3a6f12e40964b47685 to your computer and use it in GitHub Desktop.
const {
Function,
parsedJid,
getBuffer
} = require("../lib/");
const url1 = 'https://i.imgur.com/kxwRM1c.jpg'
const url2 = 'https://i.imgur.com/0I0KONy.jpeg'
Function({
pattern: 'cf ?(.*)',
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(url1)
const image2 = await getBuffer(url2)
const options = {}
options.contextInfo = {
forwardingScore: 5, // change it to 999 for many times forwarded
isForwarded: false,
}
options.linkPreview = {
title: '𝛨𝛯𝑅𝛭π›ͺ𝑇',
body: '𝐌𝐚𝐝𝐞 𝐛𝐲 𝐑𝐞𝐫𝐦𝐒𝐭 𝐰𝐒𝐭𝐑 πŸ’œ',
mediaType: 2,
thumbnail: image2,
mediaUrl: 'https://www.instagram.com/p/heehe', // insta link for video
sourceUrl: 'https://github.com/A-d-i-t-h-y-a-n',
showAdAttribution: true
}
options.filesize = 9999999999999;
options.quoted = {
key: {
fromMe: false,
participant: `0@s.whatsapp.net`,
...(m.jid ? {
remoteJid: `status@broadcast`
} : {})
},
message: {
'contactMessage': {
'displayName': '𝐌𝐚𝐝𝐞 𝐛𝐲 𝐚𝐝𝐒𝐭𝐑𝐲𝐚𝐧 𝐰𝐒𝐭𝐑 πŸ’œ',
'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:XL;'𝐌𝐚𝐝𝐞 𝐛𝐲 𝐚𝐝𝐒𝐭𝐑𝐲𝐚𝐧 𝐰𝐒𝐭𝐑 πŸ’œ',;;;\nFN:'𝐌𝐚𝐝𝐞 𝐛𝐲 𝐚𝐝𝐒𝐭𝐑𝐲𝐚𝐧 𝐰𝐒𝐭𝐑 πŸ’œ',\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`,
'jpegThumbnail': image1
}
}
}
if (/audio/.test(m.mine)) {
options.duration = 2000001355
options.ptt = false
}
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