chore(go-wxhelper): add AI command functionality 🤖

Add AI command functionality to handle AI commands in the WeChat plugin. Includes options to enable or disable AI features.
This commit is contained in:
李寻欢
2024-04-12 10:48:46 +08:00
parent f775f1d67d
commit 3da8b327d0
5 changed files with 78 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ import (
"go-wechat/config"
"go-wechat/entity"
"go-wechat/model"
"go-wechat/utils"
"gorm.io/gorm"
"log"
"slices"
@@ -72,6 +73,8 @@ func Sync() {
log.Printf("新增好友失败: %s", err.Error())
continue
}
// 发送一条新消息
utils.SendMessage(friend.Wxid, "", "大家好我是一个AI机器人可以直接@我询问你想问的问题。该功能默认未启用,请群主艾特我并发送 /ai enable 指令启用", 0)
} else {
pm := map[string]any{
"nickname": friend.Nickname,