CSC510-Group-25 / ClassMateBot

This project helps to improve the life of students, TAs and teachers by automating many mundane tasks which are sometimes done manually on Discord. This is release version 3 of the ClassMateBot.
MIT License
0 stars 5 forks source link

Profanity filter update: toggle filter, basic whitelisting commands #98

Closed snapcat closed 2 years ago

snapcat commented 2 years ago

Summary

This PR handles basic profanity filter commands.

All command names are added to the whitelist on startup.

New command:

$toggleFilter: toggles the profanity filter on/off, instructor/admin only $whitelist (word): adds a word or sentence to the whitelist, instructor/admin only $dewhitelist (word): removes a word or sentence from the whitelist, instructor/admin only

New Files

* cogs/wordfilter.py: nonfunctional placeholder
* profanity_helper.py: an assistant to help with managing the profanity filter
* default_whitelist.txt: a default whitelist
* profanity_files folder: placeholder as of now, will be used to load/save whitelisted and custom censored words

Changed Files

bot.py:

$toggleFilter: toggles the profanity filter on/off, instructor/admin only $whitelist (word): adds a word to the whitelist, instructor/admin only $dewhitelist (word): removes a word or sentence from the whitelist, instructor/admin only

Checklist

Nothing broke, and it's hard to unit test bot.py. It was manually tested though.

Checklist from #97:


Closing Issues

Resolves #87 Resolves #100

Bugfixes

100

When text is censored, Discord formats it in an often nonsensical way. This PR fixes that bug and properly applies censorship.

Notes

Got the ball rolling on #96: preventing commands from being censored. All command names are added to the whitelist on startup. #### Contributors @snapcat
codecov-commenter commented 2 years ago

Codecov Report

Merging #98 (20a3852) into main (0202c8f) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #98   +/-   ##
=======================================
  Coverage   72.97%   72.97%           
=======================================
  Files          11       11           
  Lines         729      729           
=======================================
  Hits          532      532           
  Misses        197      197           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0202c8f...20a3852. Read the comment docs.