wechat-robot/pkg/message/handler.go
2025-04-24 16:07:34 +08:00

20 lines
556 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package message
import (
"gitee.ltd/lxh/wechat-robot/internal/model"
"gitee.ltd/lxh/wechat-robot/internal/types"
"gitee.ltd/lxh/xybot"
)
// Handler
// @description: 处理微信消息
// @param msg *model.Message 数据库保存的消息记录
// @param client *xybot.Client 机器人客户端
func Handler(msg *model.Message, client *xybot.Client) {
// 处理一下如果是图片、文件、表情包等信息直接下载下来存到OSS
if msg.Type == types.MsgTypeImage || msg.Type == types.MsgTypeVideo {
handlerMedia(msg, client)
}
}