Lower-case filter words automatically.

It's never specified that words must be lower case, make it fool-proof.
This commit is contained in:
Daniel 2020-07-25 17:44:05 -05:00 committed by GitHub
parent b4769d2383
commit 698104441a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ from houdini.handlers.play.moderation import moderator_ban
@handlers.boot
async def filter_load(server):
server.chat_filter_words = await ChatFilterRuleCollection.get_collection()
server.chat_filter_words = {w.lower(): c for w, c in await ChatFilterRuleCollection.get_collection().items()}
server.logger.info(f'Loaded {len(server.chat_filter_words)} filter words')