package message

import (
	"gitee.ltd/lxh/wechat-robot/internal/model"
	"gitee.ltd/lxh/wechat-robot/internal/types"
	"gitee.ltd/wechat-client/xybot"
)

// Handler
// @description: 处理微信消息
// @param msg *model.Message 数据库保存的消息记录
// @param client *xybot.Client 机器人客户端
func Handler(msg *model.Message, client *xybot.Client) {
	switch msg.Type {
	case types.MsgTypeImage, types.MsgTypeVideo:
		// 图片、视频消息
		handlerMedia(msg, client)
	case types.MsgTypeEmoticon:
		// 表情包消息
		handlerEmoticon(msg, client)
	case types.MsgTypeVoice:
		// 语音消息
		handlerVoice(msg, client)
	}

}
