YTP button "stealsong" and !stealsong not equal


Currently player fires an event to just grab the song, it doesn’t call the Command. And it causes when u hit the button, refund for stealing doesnt work as when u use command !stealsong


I believe this was discussed on discord and it was mentioned you should make a feature request to get it working how you want.

Alternatively you could modify the files to do it yourself.


I was started this topic in feature request, but maybe its not enough info or something, and it was moved to support i think…


Support is for getting help running the bot. Whether it be something not working right, or you’re unsure how to get something to work.

What you’re asking for, is a change in how something currently works. Now, if you were asking to do it yourself, that could somewhat qualify as a support thread. But, what you’re asking is for the feature to be implemented into the bot, which is what makes it a Feature Request.

And a P.S: We ask that you fill out a template when posting to the support section as it lets us know about your bot and what you’re running, to help you easier.


in the file PhantomBot\web\ytplayer\js\ytPlayer.js on or around like 288 inside the function stealSong(id) add sendCommand('stealsong'); after the debugMsg("deleteSong::connection.send(" + JSON.stringify(jsonObject) + ")"); and that should then run the command???

I think thats what your wanting


That would run the steal song function twice @TheRealAlixe
You can’t just add code to run the command, you have to delete code to stop the web player from stealing a copy too.


I asked to open a feature request for tracking purposes.

That said, what Alixe said I think is pretty much right, you have to generate an event to run the command (or copy the logic for the command, but that is wasteful) from the event catch:

$.bind('yTPlayerStealSong', function(event) {

Right now, it just steals the song to the list, never calls the command.

You can call something like:

EventBus.instance().post(new CommandEvent($.botName, 'stealsong', ''));

I didn’t test this, so I think it is right, but I could be very wrong. That is the thing, the simplest changes sometimes aren’t are simple as they appear (or they are simple after all!).


songs cant be added twice to a playlist so even if it was to steal it twice it wouldnt really matter cus it can only add it to the play list once


I will say the reason we designed the events for the Panel and YTP to work this way is to be silent. This way if the broadcaster is clicking away like crazy, chat doesn’t get too much data in it. Of course, the refund logic was added much later in the game after the initial creation of the script. I think, from my chair, I had figured some mod would always listen to a caster saying “I love this song, steal it!” because I know when a good number of folks stream, they might not have to time to swap between windows or PCs to click a button. Basically, this wasn’t a follow through after hearing the original request which was for the command to only steal songs. Hence, a feature request :slight_smile:


Because it will spam chat that it already exists. Spamming chat is bad, we try to avoid that.


oh got ya :slight_smile: thanks for the clarification :stuck_out_tongue:


No problem. What I said above, I think will work, I will see if I can get the change in today after the job that pays me :smiley:


hehe ya always good to go for paid work over non paid first <3


Thanks all for the answers. Il try change it locally.


If it works, submit a pull request, if you are not familiar with Git, at least let me know that it works and that you made the change (or additional changes) so that I can try to duplicate it and test it and then merge it.



I realize now that the fix I proposed has issues. On the player you can steal any song, so the YTP event sends that song ID over to the Core and then to the script to steal. The !stealsong command just steals the song playing, a little bit different.


This has been handled in 1716

This required the event sent to also include the requester and to send that along when applicable. Now, the refundUser is either looked up or provided from the event via the interface and, it so configured, a refund will occur along with a message.


Thanks a lot!
this changes would be in next version of bot?


Next Nightly and not sure when the next Stable Release is, but yes.


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