[Feature Request] Blacklist for search terms or URLs
- Dominant language
- Java
- Stars
- 5.8k
- Forks
- 2.8k
- PR merge metrics
- No merged PRs in 30d
Description
### 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?
1. Every conceivable search term for Last Christmas is added to the blacklist.
2. A user tries to play the banned song.
3. 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](https://jmusicbot.com/) to make sure this feature doesn't already exist
- [X] I have searched for [similar feature requests](https://github.com/jagrosh/MusicBot/labels/enhancement)
- [X] I have confirmed that my requests is **not** on the [list of things that will not be added](https://jmusicbot.com/things-that-wont-be-added)
- [X] I am running the latest version of the bot: 
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue points to doCommand() in PlayCmd.java; start by tracing how search terms and URLs are handled there and how configuration is loaded. Define blacklist behavior for both searches and direct URLs, including the refusal response. Done means configured blacklist entries prevent matching playback without hard-coded terms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100