shipgirlproject / Shoukaku

A stable, powerful and updated wrapper around Lavalink
https://guide.shoukaku.shipgirl.moe/
MIT License
273 stars 84 forks source link

.playTrack() will not change the boolean value of .paused in v4.0.1 #175

Closed blackink7777 closed 2 months ago

blackink7777 commented 5 months ago

I don't know if this is a logic error on my part or a bug haha

When I was making a function to determine whether to stop music, I accidentally discovered that after I used the .setPaused(true) function, I directly used the.playTrack(options: {noReplace: false}) function to play new music (that is, I would Replace the current music and play), at this point I use the .paused logic to determine if the music is not playing and will return a true value, but this is obviously wrong.

await this.connection[guildId].playTrack({
    track: result.data.encoded,
    options: {
         volume: 20,
         noReplace: false
    }
});
console.log(this.connection[guildId]?.paused) // return: false
this.connection[guildId].setPaused(true)
console.log(this.connection[guildId]?.paused) // return: true
await this.connection[guildId].playTrack({
    track: result.data.encoded,
    options: {
         volume: 20,
         noReplace: false
    }
});
console.log(this.connection[guildId]?.paused) // return: true

If the problem is solved please remember to remind me, love you :>

Deivu commented 4 months ago

See latest commits and see if this fixes your issue

0t4u commented 2 months ago

PR merged