Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs Blacklist Function #37

Open
VideoGameRoulette opened this issue Jul 18, 2015 · 0 comments
Open

Needs Blacklist Function #37

VideoGameRoulette opened this issue Jul 18, 2015 · 0 comments

Comments

@VideoGameRoulette
Copy link

Due to the amount of trolls on twitch I think it would be a good idea to write a blacklist function for blacklisting youtube links from being played at all! This way we can ban youtube links from ever being requested in the first place.

One way this could work is the mod of chat would type !blacklistsong and the current songs url would be copied and paste into a text document or something so that user's can pre-emptively blacklist songs commonly requested that why know we want banned ahead of time then as more fly in from chat we can blacklist them using the command.

Once a songs been blacklisted if requested in chat then the bot should reply saying this link or song has been blacklisted! and just return with nothing after that.

This should be a simple case statement of having the bot read and search for entire link or a parse version of the link if thats easier to do example shown below.

------Chat------------------------------------------------------------------------------
User: !songrequest https://www.youtube.com/watch?v=o_cikTgwMXY
Bot->Runs Check if (%blacklist = %youtubeurl)
------mSL------
on *:TEXT:!songrequest *:#: {
var %youtubeurl = $2
if ($read(Blacklist.txt,w,%youtubeurl) == %youtubeurl) {
msg # This Song has Been Blacklisted and Cannot be Requested! | halt
}
if ($read(Blacklist.txt,w,%youtubeurl) != %youtubeurl) {
msg # Song has Been Added to Queue!
}
}
------mSLend------
Bot-> Reads and Searches Blacklist.txt for url or parsed link
------TXT------
https://www.youtube.com/watch?v=o_cikTgwMXY
o_cikTgwMXY
------TXTend------
Bot: This Song has Been Blacklisted and Cannot be Requested!
------Chatend---------------------------------------------------------------------------

This is just an example of how a blacklist would be written in mSL so it would have to be converted to Java but basically we have the bot search all lines in the text file to see if it matches to the provided url or parsed link if yes inform the user its blacklisted if no then allow the song to be added to queue as intended.

As for how to write the blacklist command in mSL we would write it like so

------mSL------
on *:TEXT:!blacklist:#: {
var %songurl = $gettok(%currentsong,1,32)
msg # %songurl has Been Added to the Blacklist!
write BlackList.txt %songurl
}
------mSLend------

This would grab the url from current song playing and add it to blacklist so it can no longer be played again obviously the skip song function would need to be added into the blacklist function so it both skips the song and adds the url to text file. Again this above is all written in mSL so you have an idea of what is needed to be done to create such a function hope it helps.

If you could add this function to the bot it would make your song request bot one step ahead of all the other request bots cause no other bot does it and i know its possible to do cause its been done before and not released to the public.

Cheers,
VGR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant