summaryrefslogtreecommitdiff
path: root/chat.py
diff options
context:
space:
mode:
Diffstat (limited to 'chat.py')
-rwxr-xr-xchat.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/chat.py b/chat.py
index 5fecb51..73a4ae4 100755
--- a/chat.py
+++ b/chat.py
@@ -3,7 +3,7 @@ from collections import deque
import net.mapserv as mapserv
import badge
from loggers import debuglog
-from utils import extends
+from utils import extends, preloadArray
from textutils import preprocess as pp
from textutils import (simplify_links, remove_formatting,
replace_emotes)
@@ -15,6 +15,8 @@ afk_message = '*AFK* I am away from keyboard'
afk_ts = 0
chat_bots = ["guild", "_IRC_"]
+chat_beings_ignored = preloadArray("config/chat_beings_ignored.txt")
+chat_wisper_ignored = preloadArray("config/chat_wisper_ignored.txt")
def send_whisper(nick, message):
badge.is_afk = False
@@ -48,6 +50,11 @@ def send_whisper_result(data):
@extends('smsg_being_chat')
def being_chat(data):
+ if '*' in chat_beings_ignored:
+ return
+ real_name, _ = data.message.split(' : ', 1)
+ if real_name in chat_beings_ignored:
+ return
message = pp(data.message, pp_actions)
debuglog.info(message)
@@ -61,6 +68,10 @@ def player_chat(data):
@extends('smsg_whisper')
def got_whisper(data):
nick, message = data.nick, data.message
+ if '*' in chat_wisper_ignored:
+ return
+ if nick in chat_wisper_ignored:
+ return
message = pp(message, pp_actions)
m = "[{} ->] {}".format(nick, message)
debuglog.info(m)