diff options
author | HoraK-FDF <horak-fdf@web.de> | 2022-03-04 13:34:46 +0100 |
---|---|---|
committer | HoraK-FDF <horak-fdf@web.de> | 2022-03-04 13:34:46 +0100 |
commit | 8d97382f5eae70938dbeb490679114c8b85e5991 (patch) | |
tree | b33d855366dd1c0a5fda926e5664a7e5e6d0ca10 /chat.py | |
parent | 728ba8aa6255fa2b8be2cfc759ba202a1a712504 (diff) | |
download | manachat-8d97382f5eae70938dbeb490679114c8b85e5991.tar.gz manachat-8d97382f5eae70938dbeb490679114c8b85e5991.tar.bz2 manachat-8d97382f5eae70938dbeb490679114c8b85e5991.tar.xz manachat-8d97382f5eae70938dbeb490679114c8b85e5991.zip |
chat ignore and some fixes
Diffstat (limited to 'chat.py')
-rwxr-xr-x | chat.py | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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) |