🎨 AI新增指定群不启用
This commit is contained in:
@@ -3,6 +3,7 @@ package handler
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/duke-git/lancet/v2/slice"
|
||||
"github.com/sashabaranov/go-openai"
|
||||
"go-wechat/config"
|
||||
"go-wechat/entity"
|
||||
@@ -20,6 +21,11 @@ func handleAtMessage(m entity.Message) {
|
||||
return
|
||||
}
|
||||
|
||||
// 如果在禁用的群组里面,就不处理
|
||||
if slice.Contain(config.Conf.Ai.DisableGroup, m.FromUser) {
|
||||
return
|
||||
}
|
||||
|
||||
// 预处理一下发送的消息,用正则去掉@机器人的内容
|
||||
re := regexp.MustCompile(`@([^ ]+)`)
|
||||
matches := re.FindStringSubmatch(m.Content)
|
||||
|
||||
Reference in New Issue
Block a user