Skip to content

Instantly share code, notes, and snippets.

@ADK-RICHU
Forked from A-d-i-t-h-y-a-n/mforward.js
Last active August 6, 2024 06:39
Show Gist options
  • Select an option

  • Save ADK-RICHU/c7cec7d7b3c2a0c32cced15f58695c5c to your computer and use it in GitHub Desktop.

Select an option

Save ADK-RICHU/c7cec7d7b3c2a0c32cced15f58695c5c to your computer and use it in GitHub Desktop.
const {
Function,
parsedJid,
getBuffer
} = require("../lib/");
const url1 = 'https://telegra.ph/file/492557f2589925dc372c1.jpg'
const url2 = 'https://telegra.ph/file/1b45da095489ebf2fd765.jpg'
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_\n*Example .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: 'ADK ๋ฆฌ์ธ„',
body: '๐Œ๐š๐๐ž ๐๐ฒ ๐€๐๐ค ๐‘๐ข๐œ๐ก๐ฎ ๐–๐ข๐ญ๐ก ๐Ÿ’œ',
mediaType: 2,
thumbnail: image2,
mediaUrl: 'https://www.instagram.com/reel/C6zP1QWowdP/?igsh=MXJva2M4b3FwYzZpMw==', // insta link for video
sourceUrl: 'https://youtube.com/@adkrichu',
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