Skip to content

Commit

Permalink
perf: 用户提问含有敏感词,新增相关日志输出(userid及用户提问内容) (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
ffinly authored Apr 14, 2023
1 parent 1c2ba15 commit 0aaf9d3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func Start() {
// 去除问题的前后空格
msgObj.Text.Content = strings.TrimSpace(msgObj.Text.Content)
if public.JudgeSensitiveWord(msgObj.Text.Content) {
logger.Info(fmt.Sprintf("🙋 %s提问的问题中包含敏感词汇,userid:%#v,消息: %#v", msgObj.SenderNick, msgObj.SenderStaffId, msgObj.Text.Content))
_, err = msgObj.ReplyToDingtalk(string(dingbot.MARKDOWN), "**🤷 抱歉,您提问的问题中包含敏感词汇,请审核自己的对话内容之后再进行!**")
if err != nil {
logger.Warning(fmt.Errorf("send message error: %v", err))
Expand Down

0 comments on commit 0aaf9d3

Please sign in to comment.