Documentation
¶
Index ¶
- type BusinessCardMessage
- type ChannelsShopOrderMessage
- type ChannelsShopProductMessage
- type EnterSessionContext
- type EventEnterSession
- type EventMessage
- type EventMessageDecoder
- type EventRejectCustomerMsgSwitchChange
- type EventSendFail
- type EventServicerRecallMsg
- type EventServicerStatusChange
- type EventSessionStatusChange
- type EventType
- type EventUserRecallMsg
- type FileMessage
- type ImageMessage
- type LinkMessage
- type LocationMessage
- type MergedMsgItem
- type MergedMsgMessage
- type MessageType
- type MiniProgramMessage
- type MsgItem
- type MsgMenuClick
- type MsgMenuItem
- type MsgMenuMessage
- type MsgMenuMiniprogram
- type MsgMenuType
- type MsgMenuView
- type TextMessage
- type VideoMessage
- type VoiceMessage
- type WechatChannel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BusinessCardMessage ¶
type BusinessCardMessage struct {
UserId string `json:"user_id"` // 用户ID
}
type ChannelsShopOrderMessage ¶
type ChannelsShopOrderMessage struct { OrderId string `json:"order_id"` // 订单ID ProductTitles string `json:"product_titles"` // 商品标题 PriceWording string `json:"price_wording"` // 订单价格描述 State string `json:"state"` // 订单状态 ImageUrl string `json:"image_url"` // 订单缩略图 ShopNickname string `json:"shop_nickname"` // 店铺名称 }
ChannelsShopOrderMessage 视频号订单信息
type ChannelsShopProductMessage ¶
type ChannelsShopProductMessage struct { ProductId string `json:"product_id"` // 商品ID HeadImage string `json:"head_image"` // 商品图片 Title string `json:"title"` // 商品标题 SalesPrice string `json:"sales_price"` // 商品价格,以分为单位 ShopNickname string `json:"shop_nickname"` // 店铺名称 ShopHeadImage string `json:"shop_head_image"` // 店铺头像 }
ChannelsShopProductMessage 视频号商品信息
type EnterSessionContext ¶
type EnterSessionContext struct { Scene string `json:"scene"` // 进入会话的场景值,获取客服账号链接开发者自定义的场景值 SceneParam string `json:"scene_param"` // 进入会话的自定义参数,获取客服账号链接返回的url,开发者按规范拼接的scene_param参数 WechatChannels WechatChannel `json:"wechat_channels"` }
type EventEnterSession ¶
type EventEnterSession struct { EventType string `json:"event_type" mapstructure:"event_type"` OpenKfid string `json:"open_kfid" mapstructure:"open_kfid"` ExternalUserid string `json:"external_userid" mapstructure:"external_userid"` Scene string `json:"scene" mapstructure:"scene"` SceneParam string `json:"scene_param" mapstructure:"scene_param"` WelcomeCode string `json:"welcome_code" mapstructure:"welcome_code"` WechatChannels struct { Nickname string `json:"nickname" mapstructure:"nickname"` Scene int `json:"scene" mapstructure:"scene"` } `json:"wechat_channels" mapstructure:"wechat_channels"` }
EventEnterSession 用户进入会话事件
type EventMessage ¶
type EventMessage map[string]interface{}
func (EventMessage) ChangeType ¶
func (e EventMessage) ChangeType() int
func (EventMessage) EventType ¶
func (e EventMessage) EventType() EventType
func (EventMessage) ExternalUserid ¶
func (e EventMessage) ExternalUserid() string
func (EventMessage) OpenKfid ¶
func (e EventMessage) OpenKfid() string
func (EventMessage) Scene ¶
func (e EventMessage) Scene() string
func (EventMessage) SceneParam ¶
func (e EventMessage) SceneParam() string
func (EventMessage) WelcomeCode ¶
func (e EventMessage) WelcomeCode() string
type EventMessageDecoder ¶
type EventMessageDecoder[T any] struct { // contains filtered or unexported fields }
func NewEventMessage ¶
func NewEventMessage[T any](msg EventMessage) *EventMessageDecoder[T]
func (EventMessageDecoder[T]) Decode ¶
func (d EventMessageDecoder[T]) Decode() (value T, err error)
type EventRejectCustomerMsgSwitchChange ¶
type EventRejectCustomerMsgSwitchChange struct { EventType string `json:"event_type"` ServicerUserid string `json:"servicer_userid"` OpenKfid string `json:"open_kfid"` ExternalUserid string `json:"external_userid"` RejectSwitch int `json:"reject_switch"` }
EventRejectCustomerMsgSwitchChange 拒收客户消息变更事件
type EventSendFail ¶
type EventSendFail struct { EventType string `json:"event_type" mapstructure:"event_type"` OpenKfid string `json:"open_kfid" mapstructure:"open_kfid"` ExternalUserid string `json:"external_userid" mapstructure:"external_userid"` FailMsgid string `json:"fail_msgid" mapstructure:"fail_msgid"` FailType int `json:"fail_type" mapstructure:"fail_type"` }
EventSendFail 消息发送失败事件
type EventServicerRecallMsg ¶
type EventServicerRecallMsg struct { EventType string `json:"event_type" mapstructure:"event_type"` OpenKfid string `json:"open_kfid" mapstructure:"open_kfid"` ExternalUserid string `json:"external_userid" mapstructure:"external_userid"` RecallMsgid string `json:"recall_msgid" mapstructure:"recall_msgid"` ServicerUserid string `json:"servicer_userid" mapstructure:"servicer_userid"` }
EventServicerRecallMsg 接待人员撤回消息事件
type EventServicerStatusChange ¶
type EventServicerStatusChange struct { EventType string `json:"event_type" mapstructure:"event_type"` ServicerUserid string `json:"servicer_userid" mapstructure:"servicer_userid"` Status int `json:"status" mapstructure:"status"` StopType int `json:"stop_type" mapstructure:"stop_type"` OpenKfid string `json:"open_kfid" mapstructure:"open_kfid"` }
EventServicerStatusChange 接待人员接待状态变更事件
type EventSessionStatusChange ¶
type EventSessionStatusChange struct { EventType string `json:"event_type" mapstructure:"event_type"` OpenKfid string `json:"open_kfid" mapstructure:"open_kfid"` ExternalUserid string `json:"external_userid" mapstructure:"external_userid"` ChangeType int `json:"change_type" mapstructure:"change_type"` OldServicerUserid string `json:"old_servicer_userid" mapstructure:"old_servicer_userid"` NewServicerUserid string `json:"new_servicer_userid" mapstructure:"new_servicer_userid"` MsgCode string `json:"msg_code" mapstructure:"msg_code"` }
EventSessionStatusChange 会话状态变更事件
type EventType ¶
type EventType string
const ( EventTypeEnterSession EventType = "enter_session" // 用户进入会话事件 EventTypeMsgSendFail EventType = "msg_send_fail" // 消息发送失败事件 EventTypeServicerStatusChange EventType = "servicer_status_change" // 接待人员接待状态变更事件 EventTypeSessionStatusChange EventType = "session_status_change" // 会话状态变更事件 EventTypeUserRecallMsg EventType = "user_recall_msg" // 用户撤回消息事件 EventTypeServicerRecallMsg EventType = "servicer_recall_msg" // 接待人员撤回消息事件 EventTypeRejectCustomerMsgSwitchChange EventType = "reject_customer_msg_switch_change" // 拒收客户消息变更事件 )
type EventUserRecallMsg ¶
type EventUserRecallMsg struct { EventType string `json:"event_type" mapstructure:"event_type"` OpenKfid string `json:"open_kfid" mapstructure:"open_kfid"` ExternalUserid string `json:"external_userid" mapstructure:"external_userid"` RecallMsgid string `json:"recall_msgid" mapstructure:"recall_msgid"` }
EventUserRecallMsg 用户撤回消息事件
type FileMessage ¶
type FileMessage struct {
MediaId string `json:"media_id"` // 文件消息媒体ID
}
type ImageMessage ¶
type ImageMessage struct {
MediaId string `json:"media_id"` // 图片消息媒体ID
}
type LinkMessage ¶
type LocationMessage ¶
type MergedMsgItem ¶
type MergedMsgMessage ¶
type MergedMsgMessage struct { Title string `json:"title"` // 聊天记录标题 Item []MergedMsgItem `json:"item"` }
MergedMsgMessage 聊天记录消息
type MessageType ¶
type MessageType string // 消息类型
const ( MessageTypeText MessageType = "text" // 文本消息 MessageTypeImage MessageType = "image" // 图片消息 MessageTypeVoice MessageType = "voice" // 语音消息 MessageTypeVideo MessageType = "video" // 视频消息 MessageTypeFile MessageType = "file" // 文件消息 MessageTypeLocation MessageType = "location" // 位置消息 MessageTypeLink MessageType = "link" // 链接消息 MessageTypeBusinessCard MessageType = "business_card" // 名片消息 MessageTypeMiniProgram MessageType = "miniprogram" // 小程序消息 MessageTypeMsgMenu MessageType = "msgmenu" // 菜单消息 MessageTypeChannelsShopProduct MessageType = "channels_shop_product" // 视频号商品消息 MessageTypeChannelsShopOrder MessageType = "channels_shop_order" // 视频号订单消息 MessageTypeMergedMsg MessageType = "merged_msg" // 聊天记录消息 MessageTypeChannels MessageType = "channels" // 视频号消息 MessageTypeMeeting MessageType = "meeting" // 会议消息 MessageTypeSchedule MessageType = "schedule" // 日程消息 MessageTypeEvent MessageType = "event" // 事件消息 )
type MiniProgramMessage ¶
type MsgItem ¶
type MsgItem struct { MsgType MessageType `json:"msgtype"` Text *TextMessage `json:"text,omitempty"` Image *ImageMessage `json:"image,omitempty"` Voice *VoiceMessage `json:"voice,omitempty"` Video *VideoMessage `json:"video,omitempty"` File *FileMessage `json:"file,omitempty"` Location *LocationMessage `json:"location,omitempty"` Link *LinkMessage `json:"link,omitempty"` BusinessCard *BusinessCardMessage `json:"business_card,omitempty"` MiniProgram *MiniProgramMessage `json:"miniprogram,omitempty"` MsgMenu *MsgMenuMessage `json:"msgmenu,omitempty"` ChannelsShopProduct *ChannelsShopProductMessage `json:"channels_shop_product,omitempty"` ChannelsShopOrder *ChannelsShopOrderMessage `json:"channels_shop_order,omitempty"` MergedMsg *MergedMsgMessage `json:"merged_msg,omitempty"` Event *EventMessage `json:"event"` }
type MsgMenuClick ¶
type MsgMenuItem ¶
type MsgMenuItem struct { Type MsgMenuType `json:"type"` // 菜单类型 Click *MsgMenuClick `json:"click"` View *MsgMenuView `json:"view"` Miniprogram *MsgMenuMiniprogram `json:"miniprogram"` }
type MsgMenuMessage ¶
type MsgMenuMessage struct { HeadContent string `json:"head_content"` // 起始文本 List []MsgMenuItem `json:"list"` // 菜单项配置 TailContent string `json:"tail_content"` // 结束文本 }
MsgMenuMessage 菜单消息
type MsgMenuMiniprogram ¶
type MsgMenuType ¶
type MsgMenuType string
const ( MsgMenuTypeClick MsgMenuType = "click" // 回复菜单 MsgMenuTypeView MsgMenuType = "view" // 超链接菜单 MsgMenuTypeMiniprogram MsgMenuType = "miniprogram" // 小程序菜单 )
type MsgMenuView ¶
type TextMessage ¶
type VideoMessage ¶
type VideoMessage struct {
MediaId string `json:"media_id"` // 视频消息媒体ID
}
type VoiceMessage ¶
type VoiceMessage struct {
MediaId string `json:"media_id"` // 语音消息媒体ID
}
type WechatChannel ¶
Click to show internal directories.
Click to hide internal directories.