Skip to content

Instantly share code, notes, and snippets.

@insanebwoi
Last active July 7, 2024 06:02
Show Gist options
  • Save insanebwoi/a256b2751ad6298b5374eb40f9f62758 to your computer and use it in GitHub Desktop.
Save insanebwoi/a256b2751ad6298b5374eb40f9f62758 to your computer and use it in GitHub Desktop.
const insane = require("../Utilis/events");
const { forwardOrBroadCast } = require("../Utilis/groupmute");
const { getBuffer } = require('../Utilis/download');
const { parseJid } = require("../Utilis/vote");
// fully custamaised by insane boy....
// Tnx to lyfe......
insane.addCommand(
{ pattern: 'cmfor ?(.*)', fromMe: true, desc: "Forward replied msg." },
async (message, match) => {
let [caption, duration, url] = match.split(";")
if (match == "") return await message.sendMessage("*Use by Given format*\nExample .cmfor caption;99;https://i.imgur.com/BiLC1Ik.jpeg;jid1 jid2 jid3 jid4 ...");
if (!message.reply_message)
return await message.sendMessage("*Reply to a Message*");
const buff = await getBuffer(url)
let options = {}
/* delete this line for forwarded tag
//for forward tag
options.contextInfo = {
forwardingScore: 5, // change it to 999 for many times forwarded
isForwarded: true
}
delete this line for forwarded tag */
options.duration = duration
options.ptt = true // delete this if not need audio as voice always
options.quoted = {
key: {
fromMe: false,
participant: "[email protected]",
remoteJid: "status@broadcast"
},
message: {
"imageMessage": {
"jpegThumbnail": buff.buffer,
"caption": caption
}
}
}
match.match(parseJid).map((jid) => {
forwardOrBroadCast(jid, message, options);
});
}
);
// insane.addCommand(
// { pattern: 'vforward ?(.*)', fromMe: true, desc: "Forward replied msg." },
// async (message, match) => {
// if (match == "") return await message.sendMessage("*Give me a jid*\nExample .mforward jid1 jid2 jid3 jid4 ...");
// if (!message.reply_message)
// return await message.sendMessage("*Give me a jid*\nExample .mforward jid1 jid2 jid3 jid4 ...");
// const { buffer, type, options } = await forward(match, message);
// options.viewOnce = true
// match.match(parseJid).map(async jid => {
// if(jid.length < 30){
// await new Promise((r) => setTimeout(r, 3000));
// await message.client.sendMessage(jid, buffer, type, options);
// }
// })
// }
// );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment