0

Well, when I try to run the command it just doesn't return anything (note: it doesn't print anything after the command is finished)

Here's all my code (discord.js)

function run(interaction, client, slash) {
    const [file, rnum] = [interaction.options.getAttachment("file").url, Math.floor(Math.random() * 999)]

    interaction.reply("adding bypass to your audio   " + slash)

    fs.readdir(__dirname + `${slash}baits`, function (err, Baits) {
        https.get(file, function (response) {
            console.log(true)
            var Bait = __dirname + `${slash}baits${slash}${Baits[Math.floor(Math.random() * Baits.length)]}`
            var [A, B, output] = [__dirname + `${slash}tmp${slash}A_${rnum}.ogg`, __dirname + `${slash}tmp${slash}B_${rnum}.ogg`, __dirname + `${slash}tmp${slash}bbbbbb${rnum}.ogg`]
            var modbait = __dirname + "${slash}tmp${slash}baitt" + rnum
            var concat = `copy /b "${modbait}" + "${B}" "${output}"`
            var DeleteFiles = `Del "${A}" "${B}" "${output}"`

            var endFile = fs.createWriteStream(A);
            var stream = response.pipe(endFile);
            stream.on('finish', function () {
                ffmpeg(Bait)
                    .toFormat("ogg")
                    .saveToFile(modbait)
                    .on('end', function () {
                        console.log(true)
                        ffmpeg(A)
                            .audioChannels(2)
                            .audioFrequency(32000)
                            .saveToFile(B)
                            .on('end', function () {
                                console.log(true) // does not print anything
                                if (err) throw err;
                                _exec(concat, function (err) {
                                    if (err) throw err;
    
    
                                    interaction.channel.send({
                                        content: "oi",
                                        files: [
                                            output
                                        ]
                                    });
                                    setTimeout(() => { _exec(DeleteFiles, () => { console.log('Deleted All Files') }) }, 15000);
                                });
                            })
                    })
            });
        })
    });
}

I've tried everything, and nothing works.

miguel
  • 26
  • 3
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Feb 16 '23 at 19:38

0 Answers0