You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 25, 2020. It is now read-only.
I have a music bot and it streams audio from youtube well. Now I want to detect if it is already streaming something. My current code that simply streams is this:
where youtube.stream is just the ytdl-core library.
I know I can keep a flag that is turned true when play starts and add a stream.once('done', () => flag = false), to turn it off, but this doesn't seem to be the most robust solution. The stream object itself should have some property that can tell if it is receiving any audio already.
I have a music bot and it streams audio from youtube well. Now I want to detect if it is already streaming something. My current code that simply streams is this:
where
youtube.streamis just the ytdl-core library.I know I can keep a
flagthat is turned true when play starts and add astream.once('done', () => flag = false), to turn it off, but this doesn't seem to be the most robust solution. The stream object itself should have some property that can tell if it is receiving any audio already.So..... any help would be appreciated 😄