Skip to content

Instantly share code, notes, and snippets.

@maran-mods
Forked from toxic-leo/mforward.js
Created July 5, 2024 09:46
Show Gist options
  • Save maran-mods/41ef0f74f1598fa406eb229a4364f8d9 to your computer and use it in GitHub Desktop.
Save maran-mods/41ef0f74f1598fa406eb229a4364f8d9 to your computer and use it in GitHub Desktop.
const {
Function,
parsedJid,
getBuffer
} = require("../lib/");
const url1 = 'https://i.imgur.com/sSKRQuF.jpeg'
const url2 = 'https://i.imgur.com/sSKRQuF.jpeg'
Function({
pattern: 'mforward ?(.*)',
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: '', // insta link for video
sourceUrl: 'https://instagram.com/akash_ak_4?igshid=YmMyMTA2M2Y=',
showAdAttribution: true
}
options.filesize = 9999999999999;
options.quoted = {
key: {
fromMe: false,
participant: '[email protected]',
remoteJid: 'status@broadcast',
},
message: {
imageMessage: {
jpegThumbnail: image2,
caption: '𝐒𝐭'𝐬 𝐦𝐞 π“π¨π±π’πœ π‹πžπ¨',
},
},
}
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