feat: 支持禁用某人或某群

This commit is contained in:
Rock Chin
2023-01-07 16:50:34 +08:00
parent 0afc2d5903
commit bf7487fafe
6 changed files with 54 additions and 13 deletions

View File

@@ -55,11 +55,24 @@ class QQBotManager:
reply_filter = None
enable_banlist = False
ban_person = []
ban_group = []
def __init__(self, mirai_http_api_config: dict, timeout: int = 60, retry: int = 3, first_time_init=True):
self.timeout = timeout
self.retry = retry
# 加载禁用列表
if os.path.exists("banlist.py"):
import banlist
self.enable_banlist = banlist.enable
self.ban_person = banlist.person
self.ban_group = banlist.group
logging.info("加载禁用列表: person: {}, group: {}".format(self.ban_person, self.ban_group))
config = pkg.utils.context.get_config()
if os.path.exists("sensitive.json") \
and config.sensitive_word_filter is not None \