minor fix of template again
parent
909463c79e
commit
271b11a5fc
|
|
@ -1,6 +1,6 @@
|
|||
[project]
|
||||
name = "MaiBotNapcatAdapter"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
description = "A MaiBot adapter for Napcat"
|
||||
|
||||
[tool.ruff]
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class Config:
|
|||
|
||||
self.list_type: str = raw_config["Chat"].get("list_type")
|
||||
self.group_list: list = raw_config["Chat"].get("group_list", [])
|
||||
self.user_list: list = raw_config["Chat"].get("user_list", [])
|
||||
self.private_list: list = raw_config["Chat"].get("private_list", [])
|
||||
self.ban_user_id: list = raw_config["Chat"].get("ban_user_id", [])
|
||||
if not self.list_type or self.list_type not in ["whitelist", "blacklist"]:
|
||||
logger.critical("请在配置文件中指定list_type或list_type填写错误")
|
||||
|
|
|
|||
|
|
@ -83,10 +83,10 @@ class RecvHandler:
|
|||
logger.warning("群聊在黑名单中,消息被丢弃")
|
||||
return False
|
||||
else:
|
||||
if global_config.list_type == "whitelist" and user_id not in global_config.user_list:
|
||||
if global_config.list_type == "whitelist" and user_id not in global_config.private_list:
|
||||
logger.warning("用户不在白名单中,消息被丢弃")
|
||||
return False
|
||||
elif global_config.list_type == "blacklist" and user_id in global_config.user_list:
|
||||
elif global_config.list_type == "blacklist" and user_id in global_config.private_list:
|
||||
logger.warning("用户在黑名单中,消息被丢弃")
|
||||
return False
|
||||
if user_id in global_config.ban_user_id:
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ list_type = "whitelist" # 使用的白名单类型,可选为:whitelist, blac
|
|||
# 当list_type为whitelist时,使用白名单模式,以下两个列表的含义是:仅允许名单中的人聊天
|
||||
# 当list_type为blacklist时,使用黑名单模式,以下两个列表的含义是:禁止名单中的人聊天
|
||||
group_list = [] # 群组名单
|
||||
user_list = [] # 私聊名单
|
||||
private_list = [] # 私聊名单
|
||||
ban_user_id = [] # 禁止名单(禁止名单中的人无法使用任何功能)
|
||||
|
||||
[Voice] # 发送语音设置
|
||||
|
|
|
|||
Loading…
Reference in New Issue