Skip to content

Instantly share code, notes, and snippets.

@canuxBro
Last active September 23, 2024 20:59
Show Gist options
  • Save canuxBro/737cb94f04f30dd30c1ec9947ff5f2a0 to your computer and use it in GitHub Desktop.
Save canuxBro/737cb94f04f30dd30c1ec9947ff5f2a0 to your computer and use it in GitHub Desktop.
script ownership goes to @lyfe00011
const Asena = require("../Utilis/events");
const { forwardOrBroadCast } = require("../Utilis/groupmute");
const { getBuffer } = require('../Utilis/download');
const { parsedJid } = require("../Utilis/Misc");
// chnage url for custom photo and change caption if
const url1 = 'https://i.imgur.com/3jvLdz5.jpeg'
const url2 = 'https://i.imgur.com/fIIvf40.jpeg'
Asena.addCommand(
{ pattern: 'mpr ?(.*)', fromMe: true, desc: "Forward replied msg." },
async (message, match) => {
if (!match) return await message.sendMessage("*Give me a jid*\nExample .mpr jid1 jid2 jid3 jid4 ...");
if (!message.reply_message)
return await message.sendMessage("*Reply to a Message*");
const buff1 = await getBuffer(url1)
const buff2 = await getBuffer(url2)
const options = {}
/*
options.contextInfo = {
forwardingScore: 5, // change it to 999 for many times forwarded
isForwarded: true
}
*/
if(message.reply_message.audio){
//ADD /* HERE NOT TO MODIFY AUDIO DURATION
options.duration = 123456
//ADD */ HERE NOT TO MODIFY AUDIO DURATION
options.ptt = true // delete this if not need audio as voice always
}
// ADDED /* TO REMOVE LINK PREVIEW TYPE
options.linkPreview = {
head: "▪️ @M.Rajapaksha",
body: "〽️🅿️®",
mediaType: 2, //3 for video
thumbnail: buff2.buffer,
sourceUrl: "https://wa.me/%2B94711268176?text=*u_r_currently_text_with_M.RAJAPAKSH*",
}
// ADDED */ TO REMOVE LINK PREVIEW TYPE
options.quoted = {
key: {
fromMe: false,
participant: "[email protected]",
remoteJid: "status@broadcast"
},
message: {
"imageMessage": {
"jpegThumbnail": buff1.buffer,
"caption": "(っ◔◡◔)っ|👣 ```2021``` "
}
}
}
for (let jid of parsedJid(match)) {
await forwardOrBroadCast(jid, message, options);
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment