拒收戳一戳配置

pull/31/head
UnCLAS-Prommer 2025-05-18 01:14:10 +08:00
parent 271b11a5fc
commit f232a54c59
4 changed files with 7 additions and 2 deletions

View File

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

View File

@ -59,6 +59,7 @@ class Config:
self.group_list: list = raw_config["Chat"].get("group_list", [])
self.private_list: list = raw_config["Chat"].get("private_list", [])
self.ban_user_id: list = raw_config["Chat"].get("ban_user_id", [])
self.enable_poke: bool = raw_config["Chat"].get("enable_poke", True)
if not self.list_type or self.list_type not in ["whitelist", "blacklist"]:
logger.critical("请在配置文件中指定list_type或list_type填写错误")
sys.exit(1)

View File

@ -494,7 +494,10 @@ class RecvHandler:
sub_type = raw_message.get("sub_type")
match sub_type:
case NoticeType.Notify.poke:
handled_message: Seg = await self.handle_poke_notify(raw_message)
if global_config.enable_poke:
handled_message: Seg = await self.handle_poke_notify(raw_message)
else:
logger.warning("戳一戳消息被禁用")
case _:
logger.warning("不支持的notify类型")
case _:

View File

@ -18,6 +18,7 @@ list_type = "whitelist" # 使用的白名单类型可选为whitelist, blac
group_list = [] # 群组名单
private_list = [] # 私聊名单
ban_user_id = [] # 禁止名单(禁止名单中的人无法使用任何功能)
enable_poke = true # 是否启用戳一戳功能
[Voice] # 发送语音设置
use_tts = false # 是否使用tts语音请确保你配置了tts并有对应的adapter