kf

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KfOperURL = "https://api.weixin.qq.com/customservice/kfaccount"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Kf

type Kf struct {
	*context.Context
}

客服管理

func NewCustomerServer

func NewCustomerServer(context *context.Context) *Kf

func (*Kf) AddKf

func (kf *Kf) AddKf(msgRequest KfOperResponse) (msgResponse *KfOperResponse, err error)

增加客服

func (*Kf) DeleteKf

func (kf *Kf) DeleteKf(msgRequest KfOperResponse) (msgResponse *KfOperResponse, err error)

删除客服

func (*Kf) KfList

func (kf *Kf) KfList(msgRequest KfOperResponse, action string) (msgResponse *KfOperResponse, err error)

获取客服列表

func (*Kf) Send

func (kf *Kf) Send(msgRequest KfSendMsgRequest) (msgResponse *KfSendMsgResponse, err error)

发送自定义多媒体消息给客户

func (*Kf) SendTextMsg

func (kf *Kf) SendTextMsg(toUser string, content string) (msgResponse *KfSendMsgResponse, err error)

发送文本信息给客户

func (*Kf) UpdateKf

func (kf *Kf) UpdateKf(msgRequest KfOperResponse) (msgResponse *KfOperResponse, err error)

修改客服

type KfListResponse

type KfListResponse struct {
	wechatutil.CommonError
	KfList []struct {
		KfAccount    string `json:"kf_account"` // 完整客服账号,格式为:账号前缀@公众号微信号
		KfNick       string `json:"kf_nick"`    // 客服昵称
		KfId         string `json:"kf_id"`      // 客服工号
		KfHeadImgUrl string `json:"kf_headimgurl"`
	} `json:"kf_list"`
}

type KfOperRequest

type KfOperRequest struct {
	KfAccount string `json:"kf_account"` // 完整客服账号,格式为:账号前缀@公众号微信号
	NickName  string `json:"nickname"`   // 客服昵称,最长6个汉字或12个英文字符
	PassWord  string `json:"password"`   // 客服账号登录密码,格式为密码明文的32位加密MD5值。该密码仅用于在公众平台官网的多客服功能中使用,若不使用多客服功能,则不必设置密码
}

type KfOperResponse

type KfOperResponse struct {
	wechatutil.CommonError
}

type KfSendMsgRequest

type KfSendMsgRequest struct {
	ToUser  string        `json:"touser"`
	MsgType string        `json:"msgtype"`
	Text    message.Text  `json:"text"`
	Image   message.Image `json:"image"`
	Voice   message.Voice `json:"voice"`
	Video   message.Video `json:"video"`
	Music   message.Music `json:"music"`
	News    message.News  `json:"news"`

	// 客服信息(若是要以指定客服账号发送的时候)
	CustomService struct {
		KfAccount string `json:"kf_account"`
	} `json:"customservice"`
}

type KfSendMsgResponse

type KfSendMsgResponse struct {
	wechatutil.CommonError
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL