Skip to content

Instantly share code, notes, and snippets.

@itzmesuhail143
Forked from souravkl11/mention-md.js
Last active March 7, 2024 10:05
Show Gist options
  • Save itzmesuhail143/69d4f7d05f0ed03012fea20d08d27fb4 to your computer and use it in GitHub Desktop.
Save itzmesuhail143/69d4f7d05f0ed03012fea20d08d27fb4 to your computer and use it in GitHub Desktop.
Replies random audio when mentioned sudo numbers
/* Copyright strict under GNU GENERAL PUBLIC LICENSE
=> Split audios with , commas
=> Editing is not compulsory. If need to change audio, then edit
*/
const {SUDO} = require('../config');
var duration = 19998000
var audios = 'https://i.imgur.com/1h630II.mp4,https://i.imgur.com/9k1PmcO.mp4,https://i.imgur.com/MI6WIMC.mp4,https://i.imgur.com/GowmjMY.mp4,https://i.imgur.com/1PdJL9Q.mp4,https://i.imgur.com/eVY3sB7.mp4https://i.imgur.com/62QHnPd.mp4,https://i.imgur.com/8prMiZG.mp4,https://i.imgur.com/tdZ2U9s.mp4,https://i.imgur.com/vnEGomZ.mp4,https://i.imgur.com/EgwxzvJ.mp4,https://i.imgur.com/SrfX25n.mp4,https://i.imgur.com/jCDXyzP.mp4`;
const {getAudioBufferFromLink,skbuffer} = require('raganork-bot')
const {readFileSync} = require('fs')
const {Module} = require('../main');
// Module({pattern: 'mention ?(.*)', fromMe: true,dontAddCommandList: true}, (async (message, match) => {return;}));
Module({on: 'text' ,fromMe: false}, (async (message, match) => {
var jids = audios.split(',').filter(link => link.includes('mp4'));
try {var men = message.mention[0].split('@')[0]} catch {return;}
if (message.mention && message.mention[0] && SUDO.includes(men)) {
var waveform = Array.from({length: 15}, () => Math.floor(Math.random() * 100)); // use this for fancy: [0,99,0,99,0,99]
getAudioBufferFromLink(jids[Math.floor(Math.random()*jids.length)],async function(audio) {
if (audio) {
return message.client.sendMessage(message.jid, {audio,mimetype: 'audio/mp4',ptt: true,waveform }, { quoted: message.data })}
})}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment