Prompted by this: http://chat.stackexchange.com/transcript/message/33655049#33655049
I (and bwDraco) think that it would be great if we could implement a !!/blacklist-keyword command or similar.
Since we already have the !!/blacklist command implemented for websites, and the bad keyword regexes have already been separated into a text file, it should be fairly easy. All the infrastructure is there; we just need to copy/paste some code and change a few things.
While we're doing this, it might also be a good idea to rename the existing !!/blacklist command to !!/blacklist-website. I've noticed that a few people recently have misunderstood the use of the blacklist command, and changing its name should make that clear.
What are your thoughts?
If we reach an agreement that this would be a good idea, I could do this on the weekend (as long as no-one beats me to it).
I second this.
To build on this, I'd also like to see a !!/blacklist-username command. A bit earlier (see #295), I had to manually fork the repo, edit the code, and submit a pull request in order to get a username added to the blacklist.
I third this.
With that said, we've had some discussion in CHQ on this topic. Consensus seems to be that we can move plaintext (or close to plaintext) lists to resource files, but regex patterns should stay in the code (such as pattern matching websites).
Bad keywords already have their own resource file, so I support adding a command for that as a good starting point.
@ArtOfCode- Yeah, those were my thoughts. I originally was going to propose to do it for most blacklists, but then I realised that keywords and usernames were about the only other appropriate ones to move out into other files.
And I agree with the idea that regexes should stay in code while plaintext can be moved into resource files.
In 21 days, 5 commits, 2 of which involved no change (ended up being reverted). With this level of activity...
With this level of activity, it's easy to forget what you're doing with the code, so adding a new robust command to do it for us a great idea! Just what I was thinking, @hichris1234.
It's easy to forget how to add a line to a text file? Unfortunate times we live in...
Oh, definitely. I mean you've gotta remember which file it is, for a start, and our consistent naming schemes make that really difficult. And then you've gotta remember where the newline goes! And don't forget actually typing, who knows how to do that these days?
I was going so start work on this, but I ran into an obstacle that I need some input on.
Often, a blacklisted username or keyword will actually be a blacklisted phrase, where there are spaces in the 'keyword' or username. However, our current system for chat commands separates arguments by spaces, and hence if a keyword/username were to have a space in it, it would be considered to be two separate keywords/usernames.
So is there a way to get around this?
\ as escaped, and hence does not split the command at that point" ".join(message_parts) to make the command single-argument only?Does anyone have any other ideas? Or will one of the ones above be sufficient?
@angussidney Regexes can use the \s character for spaces. I'd say use the same system as blacklisted websites - split on space for multiple arguments, and blacklist entries that need spaces can use \s.
Most helpful comment
I second this.
To build on this, I'd also like to see a
!!/blacklist-usernamecommand. A bit earlier (see #295), I had to manually fork the repo, edit the code, and submit a pull request in order to get a username added to the blacklist.