Compare commits

...

6 Commits

Author SHA1 Message Date
c40dbead3e 🎨 优化词云文件地址配置
All checks were successful
BuildImage / build-image (push) Successful in 1m21s
2023-12-13 15:30:37 +08:00
cf03704ea8 Merge branch 'main' of https://gitee.ltd/lxh/go-wxhelper 2023-12-11 10:53:53 +08:00
e4af82d73e none 2023-12-11 10:49:37 +08:00
f7c5ef21af Merge branch 'main' of https://gitee.ltd/lxh/go-wxhelper 2023-12-11 10:47:59 +08:00
a1e3af7953 完善插件 2023-12-11 10:47:12 +08:00
e6c0bfe2cc 完善插件 2023-12-11 10:44:23 +08:00
4 changed files with 28 additions and 3 deletions

View File

@ -50,3 +50,7 @@ resource:
welcome-new:
type: emotion
path: 58e4150be2bba8f7b71974b10391f9e9
# 水群排行榜词云,只能是图片,末尾的`\%s`也是必须的
wordcloud:
type: image
path: D:\Share\wordcloud\%s

View File

@ -2,6 +2,7 @@ package watergroup
import (
"fmt"
"go-wechat/config"
"go-wechat/service"
"go-wechat/utils"
"log"
@ -21,11 +22,17 @@ func Month() {
for _, group := range groups {
// 消息统计
dealMonth(group.Wxid)
res, ok := config.Conf.Resource["wordcloud"]
if !ok {
continue
}
// 获取上个月月份
yd := time.Now().Local().AddDate(0, 0, -1).Format("200601")
// 发送词云
fileName := fmt.Sprintf("%s_%s.png", yd, group.Wxid)
utils.SendImage(group.Wxid, "D:\\Share\\wordcloud\\"+fileName, 0)
utils.SendImage(group.Wxid, fmt.Sprintf(res.Path, fileName), 0)
}
}

View File

@ -2,6 +2,7 @@ package watergroup
import (
"fmt"
"go-wechat/config"
"go-wechat/service"
"go-wechat/utils"
"log"
@ -21,11 +22,17 @@ func Week() {
for _, group := range groups {
// 消息统计
dealWeek(group.Wxid)
res, ok := config.Conf.Resource["wordcloud"]
if !ok {
continue
}
// 获取上周周数
year, weekNo := time.Now().Local().AddDate(0, 0, -1).ISOWeek()
// 发送词云
fileName := fmt.Sprintf("%d%d_%s.png", year, weekNo, group.Wxid)
utils.SendImage(group.Wxid, "D:\\Share\\wordcloud\\"+fileName, 0)
utils.SendImage(group.Wxid, fmt.Sprintf(res.Path, fileName), 0)
}
}

View File

@ -2,6 +2,7 @@ package watergroup
import (
"fmt"
"go-wechat/config"
"go-wechat/service"
"go-wechat/utils"
"log"
@ -23,11 +24,17 @@ func Yesterday() {
for _, group := range groups {
// 消息统计
dealYesterday(group.Wxid)
res, ok := config.Conf.Resource["wordcloud"]
if !ok {
continue
}
// 获取昨日日期
yd := time.Now().Local().AddDate(0, 0, -1).Format("20060102")
// 发送词云
fileName := fmt.Sprintf("%s_%s.png", yd, group.Wxid)
utils.SendImage(group.Wxid, "D:\\Share\\wordcloud\\"+fileName, 0)
utils.SendImage(group.Wxid, fmt.Sprintf(res.Path, fileName), 0)
}
}