无法发送本地.mp3文件! discord.js v12

问题描述

这会将空文件发送给消息作者。

Image

我该如何解决?我可以在PC上正常播放它们,但是当机器人发送它们时,它不起作用。

if (command == "mp3") {
    const filename = message.author.username


    const url = args.join(" ");

    let stream = ytdl(url,{
        encoderArgs: ["-af","asetrate=44100*1.25,bass=g=20,dynaudnorm=f=150"],fmt: "mp3",opusEncoded: false
        //downloaded the file


    });
    stream.pipe(createWriteStream(__dirname + `/downloads/${filename}.mp3`));
    //saves it

    message.reply(":white_check_mark: check your DM's");


    message.author.send({
        files: [`./downloads/${filename}.mp3`]
        //sends the file to the user

    });

}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)