AudioPlayerStatus.Idle
the bot dose not do anything when it finish
40 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
v13.12
node 16.13.1
written inside play file in commands folder , idk if this will help
wow, i think it worked
it dose not
Try replacing AudioPlayerStatus.Idle with a simple "idle" string
i've found weird thing, i have many audios, i've tried 3, 2 of them works totally fine, but one of them, if the audio finished it will not respone to any thing
this
player.on(AudioPlayerStatus.Idle,
and thisconnection.on(VoiceConnectionStatus.Disconnected,
can the issue be because the audio itselfDepends. Are you 100% sure the audio has played entirely or has it maybe been cut off?
or by any case, is the audio that fails the longest of the 3?
yes, its 64sec
and it hasnt cut off after 60 secs.. hm
it will play at least 61 sec, then the audio itself has no sound in last 2 or 3 sec. so idk
even if
I see
has cut of
connection.on(VoiceConnectionStatus.Disconnected,
this should work
if something happend
But the bot doesnt leave the vc though
as this part makes it leave but it doesnt work
line 169, connection.disconnect();
it should log this at least console.log("Disconnected ?")
only if it actually leaves the vc. Does it leave when you play the audio that doesnt seem to work?
"only if it actually leaves the vc." i didn't understand this : )
Does it leave when you play the audio that doesnt seem to work?,
it dose not
but does it leave the channel when you play a working audio?
yes
I see I see
Well maybe this would help:
https://github.com/discordjs/discord.js/issues/9185#issuecomment-1452514375
GitHub
VoiceConnection stuck in signalling state about a minute after crea...
Which package is this bug report for? voice Issue description I've noticed a bug that seems to affect also some other users (see #8482). All the VoiceConnection works as intended the first ...
show me
Adding
Fixes the issue of bot connections not working anymore after exactly one minute of no activity
in your case it would be
since you called it "connection" like pretty much everyone has
what's
Reflect
Its a namespace built into nodejs as far as I know
oh
is it saying that reflect is undefined?
no
just my mind is saying
testing
In case it bugs around/doesnt work. I just realized someone changed the code a bit:
https://github.com/discordjs/discord.js/issues/9185#issuecomment-1459083216
But yeah I hope the other one already works
ty, it worked
so if the duration is longer than a min, this issue will happen?
exactly, because of a recent update of discord
This also goes for receiving audio from other people. The bot is in the vc but is technically disconnected
and this code will change the status to idle ?
then this
player.on(AudioPlayerStatus.Idle, () => {
will workIt sends a udp packet to the api afaik, basically saying "Hey let me stay connected for longer"
Like that the entire audio plays
Not adding that will cause the audio to cut at exactly 1 minute and because of that, AudioPlayerStatus.Idle event is not fired
great
thanks a lot
Np :)
i've one question
for example i'm playing an audio now
and i want to play new audio before the first one finish
should i destroy the connection and then create a new one or it's ok to keep it
Do you want the audio to overlap or do you want the next audio to start playing right after the first one finished?
overlap
no
i mean stop the first and play the sec
dose this mean "overlap "?
Nono overlap is when both audios play at the same time for a little time
Well in that case, no I would keep the connection and then when AudioPlayerStatus.Idle is fired, you can just create a new player and play it like you did here
Maybe creating a function so you dont repeat the code would be perfect here then haha
i think u did not understand me
i mean when i play an audio and there's already a connection
should i use it
or destroy it and create new
Like for the second audio? I would just use it
The same one
<:4KR_53:1036763198801592480>
i think i had an issue before
if i played an audio then played other when with the same connection and enabled "repeat" for only the second audio, both audios will be repeated
ty anyway
how to end the post