Created
March 1, 2021 00:00
-
-
Save phaticusthiccy/a7cb56a61d8bb6cde6e2b3a9a0434505 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Asena = require('../events'); | |
const {MessageType,Mimetype} = require('@adiwajshing/baileys'); | |
const fs = require('fs'); | |
const ffmpeg = require('fluent-ffmpeg'); | |
Asena.addCommand({pattern: 'test', fromMe: true}, (async (message, match) => { | |
if (message.reply_message === false) return await message.sendMessage('Herhangi Bir Medyayı Yanıtlaman Gerekiyor!'); | |
var downloading = await message.client.sendMessage(message.jid,'Efekt Uygulanıyor!',MessageType.text); | |
var location = await message.client.downloadAndSaveMediaMessage({ | |
key: { | |
remoteJid: message.reply_message.jid, | |
id: message.reply_message.id | |
}, | |
message: message.reply_message.data.quotedMessage | |
}); | |
ffmpeg(location) | |
.outputOptions(["-y", "-af", "afade=t=in:ss=0:d=15"]) | |
.save('output.mp3') | |
.on('end', async () => { | |
await message.sendMessage(fs.readFileSync('output.mp3'), MessageType.audio, {mimetype: Mimetype.mp4Audio}); | |
}); | |
return await message.client.deleteMessage(message.jid, {id: downloading.key.id, remoteJid: message.jid, fromMe: true}) | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment