使用下面的代码(audio used)时,它将立即停止。
const dispatcher = connection.playFile('./memes/china.mp3');
dispatcher.on('end', () => {
message.guild.voiceConnection.disconnect();
});
如果我使用其他代码,音频可以正常播放,但是漫游器只有在我用命令强制它离开通道后才会离开通道。
const fs = require('fs');
const stream = fs.createReadStream('./memes/china.mp3');
connection.playStream(stream);
stream.on('end', () => {
message.reply("There is a Discord bug RN plese use !leave after this SFX is done playing!");
});
如何使它正常工作?