Skip to content

Instantly share code, notes, and snippets.

@ShuhaibNC
Created July 16, 2022 05:37
Show Gist options
  • Select an option

  • Save ShuhaibNC/eba908e36f5fda6f620475387e424220 to your computer and use it in GitHub Desktop.

Select an option

Save ShuhaibNC/eba908e36f5fda6f620475387e424220 to your computer and use it in GitHub Desktop.
const {
forwardOrBroadCast,
bot,
parsedJid,
getBuffer,
options,
} = require('../lib/')
const url = 'https://telegra.ph/file/1e167ebc232063fc03226.jpg'
bot(
{ pattern: 'nc ?(.*)', fromMe: true, desc: "Forward replied msg." },
async (message, match) => {
if (!match) return await message.sendMessage("*Give me a jid*\nExample .Q jid1 jid2 jid3 jid4 ...");
if (!message.reply_message)
return await message.sendMessage("*πšπšŽπš™πš•πš’ πšƒπš˜ 𝙰 πš–πšŽπšœπšœπšŽπšŠπšπšŽβ£οΈŽ*");
const buff = await getBuffer(url)
const options = {}
if(message.reply_message.audio){
options.ptt = false // delete this if not need audio as voice always
}
options.linkPreview = {
showAdAttribution: true,
head: " --- κœ±Κœα΄œΚœα΄€ΙͺΚ™ Ι΄ α΄„ ---",
thumbnail: buff.buffer,
mediaType: 2,
sourceUrl: ""
}
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