私は音楽を演奏するDiscordボットを作っていますが、それは動作していますが、それは曲を再生する能力しかありません。最初の曲が終了するのを待つのではなく、最初の曲をキャンセルして2番目の曲にまっすぐに進みます。私はdiscord.jsを使用しています。私はコードをGitHubに入れました。ここに私のコードは次のとおりです。 `ディスカバリーミュージックボットに音楽用のキューがあるようにするにはどうすればよいですか?
if(command === '!music') {
var link = arg1
console.log(link)
const ytdl = require('ytdl-core');
const streamOptions = { seek: 0, volume: 1 };
const broadcast = bot.createVoiceBroadcast();
if(link === undefined) {
bot.guilds.get(guildid).channels.get(generalchan).send("You need to put a link after !music to put a song in the queue")
} else {
if (message.member.voiceChannel) {
message.member.voiceChannel.join()
.then(connection => { // Connection is an instance of VoiceConnection
message.reply('SONG : ' + link);
const streamOptions = { seek: 0, volume: arg2/100, filter : "audioonly" };
connection.playStream(ytdl(link), streamOptions);
})
} else {
message.reply("You need to be in a voice channel for me to join")
}
}
}'
私も投票のヘルプのような人々は、現在再生している曲をスキップして、次の曲に行くために投票することができる機能をスキップします。
Questionにコードを含めることはできますか? – guest271314
私はちょうど、あなたが私を助けることを願って – kittrz