How to have Nightbot clear AudioDJ from absent users

Hi I am a music improv streamer who allows my YouTube audience to submit song requests to my AudioDJ queue. I wanted to know if it was possible for Nightbot to periodically check to see if a user is presently watching my stream and if they are not to remove their request from AudioDJ.

I figured in theory I could create a custom command that fetched a list of all present users in the stream and then iterated through all the songs in the AudioDJ queue - checked if the requested user’s name was in the list and if not - remove the song from the queue.

Any tips would be appreciated. Thanks

There’s no way for Nightbot to know if someone is watching your stream. The most that could be done is checking the people in chat, but that is not proof of someone watching, and is extremely resource intensive for little purpose. I would recommend just occasionally clearing the queue instead to start fresh.

thanks for the reply.
So I was going to experiment with adding some javascript ina custom command. How can I get a list of the requested songs from AudioDJ? and also what exactly is the delete command?

I’m thinking I would do something where I could make a for loop where I can make some evaluation on each song in the list where if the condition is met I can delete the song from the queue. If I can get that far I think it’s possible

You can take a look at the Nightbot API docs over at which should cover getting a list of requested songs as well as deleting them.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.