1

Regarding Distube v3 in DJS v13, skipping song is poping errors when there is no up next song in the queue. The code that I was using in Distube v2 is no longer compacted to v3. I have made some adjustment based on v3 update, I would like to ask if anyone have any clues on skipping song when there is no up next song in the queue.

    const queue = client.distube.getQueue(message)
    if (!queue) return message.channel.send(`**There is nothing playing in the queue now!**`)
    try {
        await queue.skip();
        message.channel.send('**Skipped** :track_next:');
        return;
    } catch (e) {
        console.log(e);
        return;
    }
4

1 回答 1

0

我用我的机器人做的方法是检查自动播放是否关闭并且队列长度是否为 1,然后调用 stop 方法,否则调用 skip。

这应该可以解决您的问题:

if (!queue.autoplay && queue.songs.length == 1)
    queue.stop();
else
    queue.skip();
于 2022-01-18T16:39:57.420 回答