Closed Drilmo closed 1 month ago
@Drilmo discord-player indeed pauses the playback when bot is alone in a voice channel, which is most likely the reason for these events to get triggered. Though pause
event kind of makes sense here, it does not make sense for resume
event to get emitted. Therefore, this is indeed a bug.
Do you see this behavior with pauseOnEmpty: false
option? By default this is set to true
. Disabling this option should never trigger these events (unless these actions are manually called).
@Drilmo discord-player indeed pauses the playback when bot is alone in a voice channel, which is most likely the reason for these events to get triggered. Though
pause
event kind of makes sense here, it does not make sense forresume
event to get emitted. Therefore, this is indeed a bug.Do you see this behavior with
pauseOnEmpty: false
option? By default this is set totrue
. Disabling this option should never trigger these events (unless these actions are manually called).
I have the same behavior with this configuration:
nodeOptions: {
metadata: {
interaction,
volume: 100,
leaveOnEnd: false,
leaveOnStop: true,
leaveOnEmpty: true,
selfDeaf: true,
pauseOnEmpty: false,
},
},
playerPause and playerResume events are emitted
@Drilmo discord-player indeed pauses the playback when bot is alone in a voice channel, which is most likely the reason for these events to get triggered. Though
pause
event kind of makes sense here, it does not make sense forresume
event to get emitted. Therefore, this is indeed a bug. Do you see this behavior withpauseOnEmpty: false
option? By default this is set totrue
. Disabling this option should never trigger these events (unless these actions are manually called).I have the same behavior with this configuration:
nodeOptions: { metadata: { interaction, volume: 100, leaveOnEnd: false, leaveOnStop: true, leaveOnEmpty: true, selfDeaf: true, pauseOnEmpty: false, }, },
hi, everything except interaction
goes outside metadata
object.
Let me clarify this, metadata
object allows you to store raw information that you may need later on. In this case, you require interaction
object to identify where to send messages when discord-player emits an event on a queue. This object can be accessed via queue.metadata
when consuming.
Options such as volume
, leaveOnEnd
, etc. go outside metadata
as these are options for the queue itself. A guild queue does not read options from metadata
. In fact, discord-player never actually reads your metadata
internally. Correct way of doing this would be
nodeOptions: {
metadata: {
interaction,
},
volume: 100,
leaveOnEnd: false,
leaveOnStop: true,
leaveOnEmpty: true,
selfDeaf: true,
pauseOnEmpty: false,
},
Ho! thank you for this explanation indeed it's a mistake on my part! I followed a tutorial on YouTube for the initialization... Thank you very much for your time...
@twlite I tried again with pauseOnEmpty: false it works as expected. However, out of curiosity, I tested with pauseOnEmpty: true, and the playerResume event was triggered after the playerPause event.
Describe the bug When the bot is alone in the channel, it disconnects from the voice channel and emit the playerPause and playerResume events when it shouldn't.
To Reproduce Steps to reproduce the behavior: configure the bot to leave the lounge if it's alone (leaveOnEmpty: true) go to a vocal channel. call the bot play music leave the lounge
Expected behavior playerPause and playerResume events must not be emitted
Please complete the following information: