mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
change value name
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
<summary>✅支持敏感词过滤,避免账号风险</summary>
|
||||
|
||||
- 难以监测机器人与用户对话时的内容,故引入此功能以减少机器人风险
|
||||
- 加入了百度云内容审核,在`config.py`中修改`check`的值,并填写`baidu_api_key`和`baidu_secret_key`以开启此功能
|
||||
- 加入了百度云内容审核,在`config.py`中修改`baidu_check`的值,并填写`baidu_api_key`和`baidu_secret_key`以开启此功能
|
||||
- 编辑`sensitive.json`,并在`config.py`中修改`sensitive_word_filter`的值以开启此功能
|
||||
</details>
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ ignore_rules = {
|
||||
sensitive_word_filter = True
|
||||
|
||||
#是否启动百度云内容安全审核
|
||||
check = False
|
||||
baidu_check = False
|
||||
|
||||
#百度云API_KEY 24位英文数字字符串
|
||||
baidu_api_key = ""
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import re
|
||||
import requests
|
||||
import json
|
||||
from config import check, baidu_api_key, baidu_secret_key, illgalmessage
|
||||
from config import baidu_check, baidu_api_key, baidu_secret_key, illgalmessage
|
||||
import logging
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class ReplyFilter:
|
||||
|
||||
def process(self, message: str) -> str:
|
||||
# 百度云审核
|
||||
if check:
|
||||
if baidu_check:
|
||||
# 百度云审核
|
||||
payload = "text=" + message
|
||||
logging.info("向百度云发送:" + payload)
|
||||
|
||||
Reference in New Issue
Block a user