Skip to content

Instantly share code, notes, and snippets.

@Kiranxer
Last active December 15, 2023 05:08
Show Gist options
  • Save Kiranxer/c8f5c8d473073822a44f064baa09f260 to your computer and use it in GitHub Desktop.
Save Kiranxer/c8f5c8d473073822a44f064baa09f260 to your computer and use it in GitHub Desktop.
const { inrl,getVar,getBuffer} = require('../lib');
inrl({on:"all",pattern: 'automention',sucReact: "💗", category: ["external"], type : "opt"}, async (m, client, match) => {
try {
let {BOT_INFO, SUDO} = await getVar();
let IsOwner, IsSudo, Owner, Sudo
let NewMension = ["917593919575", "917025099154"],MENSION_DATA;
let IsBot = client.user.jid.split('@')[0];
NewMension.push(IsBot);
if(BOT_INFO.split(';')[0]){
Owner = BOT_INFO.split(';')[0]
NewMension.push(Owner);
};
if(!SUDO.includes(',')){
NewMension.push(SUDO.trim());
} else if(SUDO.includes(',')){
Sudo = SUDO.split(',');
NewMension = Sudo.concat(NewMension)
};
// added sudo and owner in single array//
let mP3 = "https://i.imgur.com/FP0Lavx.mp4"//if you need to add moreaudio methord = mP3 == "url1,url2,url3,etc.."
let jPg = "https://i.ibb.co/n78Qg91/cbec4edcd40c.jpg"
// options fro frd
let options = {
fileLength:999999999,
ptt:false,
mimetype:"audio/mpeg",
forwardType : "audio",
seconds :999999999999999,
waveform: [0,50,100,50,0,50,100,50,0,50,100,50,0]
}
options.linkPreview = {
showAdAttribution : true,
body:"SANIYA<3",
title:"K-7",
renderLargerThumbnail:true,
thumbnail:await getBuffer(jPg),
mediaType:2,
mediaUrl: "https://www.instagram.com/le_kiran_xer",
sourceUrl:"https://www.instagram.com/le_kiran_xer"
}
options.contextInfo = {
isForwarded:false,
forwardingScore:329
}
let matchs = m.client.displayText?.replaceAll(' ','') ||'inrl', isTrue = false;
NewMension.map(async(cc)=>{
if(!matchs.match(cc)) return;
isTrue = true
});
if(isTrue===true){
isTrue = false;
mP3 = mP3.replaceAll(' ','');
// give random and single aufion by below Function//
let content,StoreMp3;
if(!mP3.includes(',')){
content = mP3;
} else {
StoreMp3 = mP3.split(',');
content = StoreMp3[Math.floor(Math.random() * StoreMp3.length)]
}
//end
return await m.forwardMessage(m.from,content,options)
}
} catch(e){
return await m.reply(e);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment