Compare commits

..

2 Commits

Author SHA1 Message Date
1c55900291 Merge pull request '🎨 优化发给新成员的消息' (#45) from hotfix into main
All checks were successful
BuildImage / build-image (push) Successful in 1m32s
Reviewed-on: #45
2024-05-14 11:51:31 +08:00
386e0dd6d3 🎨 优化发给新成员的消息 2024-05-14 11:50:27 +08:00
2 changed files with 18 additions and 2 deletions

View File

@ -87,6 +87,10 @@ resource:
welcome-new:
type: emotion
path: 58e4150be2bba8f7b71974b10391f9e9
# 给新好友或者群的自我介绍,不配置就不发送
introduce:
type: text
path: "大家好我是一个AI机器人可以直接@我询问你想问的问题。"
# 水群排行榜词云,只能是图片,末尾的`\%s`也是必须的
wordcloud:
type: image

View File

@ -73,8 +73,20 @@ func Sync() {
log.Printf("新增好友失败: %s", err.Error())
continue
}
// 发送一条新消息
utils.SendMessage(friend.Wxid, "", "大家好我是一个AI机器人可以直接@我询问你想问的问题。该功能默认未启用,请群主艾特我并发送 /ai enable 指令启用", 0)
if conf, ok := config.Conf.Resource["introduce"]; ok {
// 发送一条新消息
switch conf.Type {
case "text":
// 文字类型
utils.SendMessage(friend.Wxid, "", conf.Path, 0)
case "image":
// 图片类型
utils.SendImage(friend.Wxid, conf.Path, 0)
case "emotion":
// 表情类型
utils.SendEmotion(friend.Wxid, conf.Path, 0)
}
}
} else {
pm := map[string]any{
"nickname": friend.Nickname,