YTP button "stealsong" and !stealsong not equal


#1

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


#2

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.


#3

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


#4

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.


#5

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


#6

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.


#7

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!).


#8

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


#9

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:


#10

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


#11

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


#12

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:


#13

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


#14

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


#15

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.

Cheers


#16

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.


#17

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.


#18

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


#19

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


#20

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