Javascript 循环播放音频文件discord.js
我一直在为我的discord机器人编写代码,让它播放音频文件,效果很好,但我不知道如何循环播放曲目,有人能帮忙吗Javascript 循环播放音频文件discord.js,javascript,discord.js,Javascript,Discord.js,我一直在为我的discord机器人编写代码,让它播放音频文件,效果很好,但我不知道如何循环播放曲目,有人能帮忙吗 const channel = client.channels.cache.get("CHANNEL ID") if (!channel) return console.error("The channel does not exist!"); channel.join().then(connection => {
const channel = client.channels.cache.get("CHANNEL ID")
if (!channel) return console.error("The channel does not exist!");
channel.join().then(connection => {
connection.play(path.join(__dirname, 'FILE NAME'))
}).catch(e => {
console.error(e);
});
这回答了你的问题吗?这回答了你的问题吗?