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

Move handling of offensive words out of user defined regular expressions and into code #36

Open
Rainbacon opened this issue Sep 27, 2019 · 3 comments

Comments

@Rainbacon
Copy link

We currently have several regular expressions under the category of "offensive". These regular expressions get printed whenever someone uses the !!/regexes command in chat. This means that the bot is routinely posting messages that contain content we've deemed offensive. In order to not keep putting this into chat, where someone might come across it, we should have these cases handled within the bot's code where they won't be constantly printed in chat. This will make it slightly harder to add new offensive words to the list of things we catch, but should be fairly maintainable moving forward.

@scohe001
Copy link
Collaborator

scohe001 commented Sep 27, 2019

Note that we treat the offensive and abusive reasons specially in the code:

if reasons.map(&:name).include?('abusive') || reasons.map(&:name).include?('offensive')
comment_text_to_post = "⚠️☢️\u{1F6A8} [Offensive/Abusive Comment](#{comment["link"]}) \u{1F6A8}☢️⚠️"
end

I'm all for this and would suggest building an offensive_abusive.txt dump with a regex on each line. But it will require some code changes as well.

Any suggestions on how to build this file or where to find one that's already built?

@Rainbacon
Copy link
Author

What I've seen done before is to make a static array, call it bad_words and just check to see if any of the words in it are contained in the post.

I did find a ruby gem that handles this

@thesecretmaster
Copy link
Owner

I like the idea of keeping all the regexes in the same place, but sticking one rude/abusive regex in the config file would work too, and solve the problem here.

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

3 participants