【问题标题】:can't resume readable stream nodejs无法恢复可读流nodejs
【发布时间】:2021-09-15 06:41:16
【问题描述】:

我正在尝试制作一个播放音乐的不和谐机器人。为了播放音乐,我使用了一个使用 ytdl-core 获得的可读流。我可以使用 .pause() 方法毫无问题地暂停它,但在使用 .resume() 之后似乎没有任何效果。这是我用于恢复功能的代码。

module.exports.run =async (client, channel, authorID, args) => {
    const ServerInfos = require("../ServerInfos").ServerInfos
    return new Promise(function (resolve, reject){
        for (let i=0;i<ServerInfos.length;i++){
            if (ServerInfos[i].ID==channel.guild.id && ServerInfos[i].AudioStream != null){
                console.log(ServerInfos[i].AudioStream)
                ServerInfos[i].AudioStream.resume()
                resolve("Music resumed")
            };
        };
    })
};
module.exports.help = {
    name: 'resume',
    description:'resumes the music',
    options:[]
};

提前感谢您的帮助:)

【问题讨论】:

    标签: node.js discord resume node-streams


    【解决方案1】:

    我能够通过将 nodejs 降级到 12.x 来解决这个问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-28
      • 1970-01-01
      • 1970-01-01
      • 2023-03-16
      相关资源
      最近更新 更多