20 lines
556 B
Go
20 lines
556 B
Go
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)
|
||
}
|
||
|
||
}
|