MusicBot
MusicBot copied to clipboard
[Feature Request] Blacklist for search terms or URLs
Is your feature request related to a problem? Please describe.
I realize that this might be an edge case, but to me, one of the most important features of any music player is that it will never, ever play Last Christmas by Wham!. With the holiday season coming up, I modified the code accordingly, but this solution isn't very convenient for most people.
A properly implemented filter could also be used to minimize trolling (people adding airhorn sounds etc. to the queue), filter out profane search terms or other much-hated songs, like most of Nickleback's catalog or Moves Like Jagger by Maroon 5. Unchecked, even trusted users with the DJ role will sometimes victimize unsuspecting VC idlers' ears with the latter problematic tunes.
What is your ideal solution to the problem?
The ideal solution would be a list of search terms or URLs in the config file, where newly discovered gems could immediately be added by the owner, either manually or with a blacklist-command. If anybody tries to search for a term or play a URL that's included in the list, the bot will refuse to do so (and ideally reply in a snarky way).
A solution like this could obviously circumvented by using a source that doesn't contain any of the banned words, but this requires much more effort on the user's end.
How would this feature be used?
- Every conceivable search term for Last Christmas is added to the blacklist.
- A user tries to play the banned song.
- Everyone's ears are protected without having to endure even the first few seconds of Last Christmas. There are cries of joy. The world is a better place.
Additional Info
I dirty-hardcoded this feature into doCommand()
in PlayCmd.java
as follows:
[...]
else if(event.getArgs().toLowerCase().contains("last christmas") || event.getArgs().toLowerCase().contains("wham") ||
(event.getArgs().toLowerCase().contains("wham") && (event.getArgs().toLowerCase().contains("last") || event.getArgs().toLowerCase().contains("christmas")) ||
event.getArgs().equals("last") || event.getArgs().contains("E8gmARGvPlI") || event.getArgs().contains("YUH8Xfz-jg") || event.getArgs().contains("FuAHR4lkjCo") || event.getArgs().contains("JRNs1yGfbsU"))) {
event.reply("No.");
return;
}
[...]
Checklist
- [X] I have checked the documentation to make sure this feature doesn't already exist
- [X] I have searched for similar feature requests
- [X] I have confirmed that my requests is not on the list of things that will not be added
- [X] I am running the latest version of the bot: