mirror of
https://github.com/solero/houdini.git
synced 2024-11-25 06:57:24 +00:00
Basic chat-filter functionality
This commit is contained in:
parent
c9907ba178
commit
399df4ad16
@ -16,6 +16,15 @@ async def handle_send_message(p, penguin_id: int, message: str):
|
|||||||
return
|
return
|
||||||
|
|
||||||
tokens = message.lower()
|
tokens = message.lower()
|
||||||
|
for word, consequence in p.server.chat_filter_words.items():
|
||||||
|
if word in tokens:
|
||||||
|
if consequence.ban:
|
||||||
|
return
|
||||||
|
elif consequence.warn:
|
||||||
|
return
|
||||||
|
elif consequence.filter:
|
||||||
|
return
|
||||||
|
|
||||||
if has_command_prefix(p.server.config.command_prefix, message):
|
if has_command_prefix(p.server.config.command_prefix, message):
|
||||||
await invoke_command_string(p.server.commands, p, message)
|
await invoke_command_string(p.server.commands, p, message)
|
||||||
else:
|
else:
|
||||||
|
@ -24,6 +24,7 @@ from houdini.data.mail import PostcardCollection
|
|||||||
from houdini.data.pet import PuffleCollection, PuffleItemCollection
|
from houdini.data.pet import PuffleCollection, PuffleItemCollection
|
||||||
from houdini.data.permission import PermissionCollection
|
from houdini.data.permission import PermissionCollection
|
||||||
from houdini.data.buddy import CharacterCollection
|
from houdini.data.buddy import CharacterCollection
|
||||||
|
from houdini.data.moderator import ChatFilterRuleCollection
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import uvloop
|
import uvloop
|
||||||
@ -74,6 +75,7 @@ class Houdini:
|
|||||||
self.plugins = PluginManager(self)
|
self.plugins = PluginManager(self)
|
||||||
|
|
||||||
self.permissions = None
|
self.permissions = None
|
||||||
|
self.chat_filter_words = None
|
||||||
|
|
||||||
self.items = None
|
self.items = None
|
||||||
self.igloos = None
|
self.igloos = None
|
||||||
|
Loading…
Reference in New Issue
Block a user