mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-18 19:44:21 +00:00
change value name
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
<summary>✅支持敏感词过滤,避免账号风险</summary>
|
<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`的值以开启此功能
|
- 编辑`sensitive.json`,并在`config.py`中修改`sensitive_word_filter`的值以开启此功能
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -107,7 +107,7 @@ ignore_rules = {
|
|||||||
sensitive_word_filter = True
|
sensitive_word_filter = True
|
||||||
|
|
||||||
#是否启动百度云内容安全审核
|
#是否启动百度云内容安全审核
|
||||||
check = False
|
baidu_check = False
|
||||||
|
|
||||||
#百度云API_KEY 24位英文数字字符串
|
#百度云API_KEY 24位英文数字字符串
|
||||||
baidu_api_key = ""
|
baidu_api_key = ""
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
import json
|
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
|
import logging
|
||||||
|
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ class ReplyFilter:
|
|||||||
|
|
||||||
def process(self, message: str) -> str:
|
def process(self, message: str) -> str:
|
||||||
# 百度云审核
|
# 百度云审核
|
||||||
if check:
|
if baidu_check:
|
||||||
# 百度云审核
|
# 百度云审核
|
||||||
payload = "text=" + message
|
payload = "text=" + message
|
||||||
logging.info("向百度云发送:" + payload)
|
logging.info("向百度云发送:" + payload)
|
||||||
|
|||||||
Reference in New Issue
Block a user