minor fix of template again

pull/31/head
UnCLAS-Prommer 2025-05-17 23:59:11 +08:00
parent 909463c79e
commit 271b11a5fc
4 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
[project]
name = "MaiBotNapcatAdapter"
version = "0.2.1"
version = "0.2.2"
description = "A MaiBot adapter for Napcat"
[tool.ruff]

View File

@ -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填写错误")

View File

@ -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:

View File

@ -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] # 发送语音设置