A way to Empty the Song Request Text File?

PhantomBot Version:
OS Version:Windows 10 Pro
Java Version: Latest
Browser and Version (for Panel Support):FireFox
Stock PhantomBot: Yes

Hello there, I was just wondering - with how I have set up a html app to read text files for Followers/Subs etc etc…
I wondered if there was a way when I’ve got Song Requests running, if while paused, OR, and this is more likely, when the Tab is closed and Song Requests get Disabled,
If the bot could clear the text file, so I won’t have it being displayed on my overlays?
If this is something that can be achieved, I would love to know, or else I’ll not display it. Not a huge deal just thought I would ask :slight_smile: Thank You!

I dont see that there is currently an option for that (plz correct me if I am wrong) but you could add something like this if u want. For that u would need to add something to the yTPlayerDisconnect event ( systems/ youtubePlayer.js) that would do what u want to achieve.

But the easiest option would be to put both the layers (audio and current song playing) in a group and disable both on demand. Even if the song request is still playing in the background disabling the group would stop recording that on most software for streaming unless otherwise configured.

Oh yes, an honest reply, i shouldn’t be lazy and start getting back into coding again :slight_smile: - as yes if there is an on disconnect event already happening, I should be able to customize it a bit :slight_smile: thank you for that hint :smiley:

Hey if u manage to get that done in any way I would like to see it. Might be able to make something out of it for myself.

well thank you for the inspiration - Sorry, I’m not used to markup formatting lol, so I’ll explain quickly,
I basically copied the code for $.writeToFile pasted that after connectedPlayerClient = null; - removed youtubeVideo.getVideoTitle() + so it would just write essentially nothing to the text file. And it seems to work fine :slight_smile: - I’m sure it could be cleaned up a bit better, but it works :slight_smile:

I really wanted this, because i have a HTML document, that displays information on a loop, through set messages, and I had it programmed to, if the text file is empty, skip that message, so it doesn’t display on stream - so that was the reasoning for me doing this for the song requests :smiley:

1 Like