fix: 紧急为check功能加入开关
This commit is contained in:
@@ -21,6 +21,7 @@ ban_words = [
|
|||||||
check_interval = 120 # 检查表情包的时间间隔
|
check_interval = 120 # 检查表情包的时间间隔
|
||||||
register_interval = 10 # 注册表情包的时间间隔
|
register_interval = 10 # 注册表情包的时间间隔
|
||||||
auto_save = true # 自动偷表情包
|
auto_save = true # 自动偷表情包
|
||||||
|
enable_check = false # 是否启用表情包过滤
|
||||||
check_prompt = "不要包含违反公序良俗的内容" # 表情包过滤要求
|
check_prompt = "不要包含违反公序良俗的内容" # 表情包过滤要求
|
||||||
|
|
||||||
[cq_code]
|
[cq_code]
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ class BotConfig:
|
|||||||
EMOJI_CHECK_INTERVAL: int = 120 # 表情包检查间隔(分钟)
|
EMOJI_CHECK_INTERVAL: int = 120 # 表情包检查间隔(分钟)
|
||||||
EMOJI_REGISTER_INTERVAL: int = 10 # 表情包注册间隔(分钟)
|
EMOJI_REGISTER_INTERVAL: int = 10 # 表情包注册间隔(分钟)
|
||||||
EMOJI_SAVE: bool = True # 偷表情包
|
EMOJI_SAVE: bool = True # 偷表情包
|
||||||
|
EMOJI_CHECK: bool = False #是否开启过滤
|
||||||
EMOJI_CHECK_PROMPT: str = "不要包含违反公序良俗的内容" # 表情包过滤要求
|
EMOJI_CHECK_PROMPT: str = "不要包含违反公序良俗的内容" # 表情包过滤要求
|
||||||
|
|
||||||
ban_words = set()
|
ban_words = set()
|
||||||
@@ -100,6 +101,7 @@ class BotConfig:
|
|||||||
config.EMOJI_REGISTER_INTERVAL = emoji_config.get("register_interval", config.EMOJI_REGISTER_INTERVAL)
|
config.EMOJI_REGISTER_INTERVAL = emoji_config.get("register_interval", config.EMOJI_REGISTER_INTERVAL)
|
||||||
config.EMOJI_CHECK_PROMPT = emoji_config.get('check_prompt',config.EMOJI_CHECK_PROMPT)
|
config.EMOJI_CHECK_PROMPT = emoji_config.get('check_prompt',config.EMOJI_CHECK_PROMPT)
|
||||||
config.EMOJI_SAVE = emoji_config.get('auto_save',config.EMOJI_SAVE)
|
config.EMOJI_SAVE = emoji_config.get('auto_save',config.EMOJI_SAVE)
|
||||||
|
config.EMOJI_CHECK = emoji_config.get('enable_check',config.EMOJI_CHECK)
|
||||||
|
|
||||||
if "cq_code" in toml_dict:
|
if "cq_code" in toml_dict:
|
||||||
cq_code_config = toml_dict["cq_code"]
|
cq_code_config = toml_dict["cq_code"]
|
||||||
|
|||||||
@@ -291,6 +291,7 @@ class EmojiManager:
|
|||||||
|
|
||||||
# 获取表情包的描述
|
# 获取表情包的描述
|
||||||
discription = await self._get_emoji_discription(image_base64)
|
discription = await self._get_emoji_discription(image_base64)
|
||||||
|
if global_config.EMOJI_CHECK:
|
||||||
check = await self._check_emoji(image_base64)
|
check = await self._check_emoji(image_base64)
|
||||||
if '是' not in check:
|
if '是' not in check:
|
||||||
os.remove(image_path)
|
os.remove(image_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user