import { WXCore } from '../WXCore'; import { Article } from '../entity/message/output/Article'; import { MenuMsg } from '../entity/message/output/MenuMsg'; /** * @description 客服消息 */ export declare class CustomServiceAPI { private static getKfListUrl; private static addKfAccountUrl; private static inviteUrl; private static updateKfAccountUrl; private static uploadKfHeadImgUrl; private static delKfAccountUrl; private static getOnlineUrl; private static customMessageUrl; private static typingUrl; private static createSessionUrl; private static closeSessionUrl; private static getSessionUrl; private static getSessionListUrl; private static getWaitCaseUrl; private static getMsgRecordUrl; private static _http; /** * 获取所有客服账号 * @param wxCore */ static getKfList(wxCore: WXCore): Promise; /** * 添加客服帐号 * @param wxCore * @param response * @param kf_account 完整客服账号,格式为:账号前缀@公众号微信 * @param nickname 客服昵称,最长6个汉字或12个英文字符 * @param password 客服账号登录密码,格式为密码明文的32位加密MD5值。该密码仅用于在公众平台官网的多客服功能中使用,若不使用多客服功能,则不必设置密码 */ static addKfAccount(wxCore: WXCore, kf_account: string, nickname: string, password?: string): Promise; /** * 邀请绑定客服帐号 * @param wxCore * @param kf_account 完整客服帐号,格式为:帐号前缀@公众号微信号 * @param inviteWx 接收绑定邀请的客服微信号 */ static inviteWorker(wxCore: WXCore, kf_account: string, inviteWx: string): Promise; /** * 设置客服信息 * @param wxCore * @param response * @param kf_account * @param nickname * @param password 客服账号登录密码,格式为密码明文的32位加密MD5值。该密码仅用于在公众平台官网的多客服功能中使用,若不使用多客服功能,则不必设置密码 */ static updateKfAccount(wxCore: WXCore, kf_account: string, nickname: string, password?: string): Promise; /** * 设置客服帐号的头像 * @param wxCore * @param response * @param kf_account * @param filePath 头像图片文件必须是jpg格式,推荐使用640*640大小的图片以达到最佳效果 */ static uploadKfAccountHeadImg(wxCore: WXCore, kf_account: string, filePath: string): Promise; /** * 删除客服帐号 * @param wxCore * @param response * @param kf_account */ static delKfAccount(wxCore: WXCore, kf_account: string): Promise; /** * 获取在线客服 * @param wxCore */ static getOnlineKfList(wxCore: WXCore): Promise; /** * 发送客服消息 * @param wxCore * @param response * @param json 各种消息的JSON数据包 * @param kf_account 以某个客服帐号来发消息 */ static sendMsg(wxCore: WXCore, msgObj: any, kf_account?: string): Promise; /** * 发送文本客服消息 * @param wxCore * @param response * @param openId * @param text */ static sendText(wxCore: WXCore, openId: string, text: string, kf_account?: string): Promise; /** * 发送图片消息 * @param wxCore * @param response * @param openId * @param text */ static sendImage(wxCore: WXCore, openId: string, media_id: string, kf_account?: string): Promise; /** * 发送语音消息 * @param wxCore * @param response * @param openId * @param media_id */ static sendVoice(wxCore: WXCore, openId: string, media_id: string, kf_account?: string): Promise; /** * 发送视频消息 * @param wxCore * @param response * @param openId * @param media_id * @param title * @param description */ static sendVideo(wxCore: WXCore, openId: string, media_id: string, title: string, description: string, kf_account?: string): Promise; /** * 发送音乐消息 * @param wxCore * @param response * @param openId * @param title * @param description * @param musicurl * @param hqmusicurl * @param thumb_media_id 缩略图/小程序卡片图片的媒体ID,小程序卡片图片建议大小为520*416 */ static sendMusic(wxCore: WXCore, openId: string, title: string, description: string, musicurl: string, hqmusicurl: string, thumb_media_id: string, kf_account?: string): Promise; /** * 发送图文消息 * @param wxCore * @param response * @param openId * @param articles * @param accessToken */ static sendNews(wxCore: WXCore, openId: string, articles: Article[], kf_account?: string): Promise; /** * 发送图文消息(点击跳转到图文消息页面) * @param wxCore * @param response * @param openId * @param media_id * @param accessToken */ static sendMpNews(wxCore: WXCore, openId: string, media_id: string, kf_account?: string): Promise; /** * 发送菜单消息 * @param wxCore * @param response * @param openId * @param head_content * @param list * @param tail_content */ static sendMenu(wxCore: WXCore, openId: string, head_content: string, list: MenuMsg[], tail_content: string, kf_account?: string): Promise; /** * 发送卡券 * @param wxCore * @param response * @param openId * @param card_id */ static sendCoupon(wxCore: WXCore, openId: string, card_id: string, kf_account?: string): Promise; /** * 发送小程序卡片(要求小程序与公众号已关联) * @param wxCore * @param openId * @param title * @param appid * @param pagepath * @param thumb_media_id 缩略图/小程序卡片图片的媒体ID,小程序卡片图片建议大小为520*416 */ static sendMiniProgramPage(wxCore: WXCore, openId: string, title: string, appid: string, pagepath: string, thumb_media_id: string, kf_account?: string): Promise; /** * 客服输入状态 * @param wxCore * @param response * @param openId * @param command "Typing":对用户下发“正在输入"状态,"CancelTyping":取消对用户的”正在输入"状态 */ static sendTyping(wxCore: WXCore, openId: string, command: string): Promise; /** * 创建会话 * @param wxCore * @param kf_account 完整客服帐号,格式为:帐号前缀@公众号微信号 * @param openid */ static createSession(wxCore: WXCore, kf_account: string, openid: string): Promise; /** * 关闭会话 * @param wxCore * @param kf_account 完整客服帐号,格式为:帐号前缀@公众号微信号 * @param openid */ static closeSession(wxCore: WXCore, kf_account: string, openid: string): Promise; /** * 获取会话状态 * @param wxCore * @param openid */ static getSession(wxCore: WXCore, openid: string): Promise; /** * 获取客服会话列表 * @param wxCore * @param kf_account */ static getSessionList(wxCore: WXCore, kf_account: string): Promise; /** * 获取未接入会话列表 * @param wxCore */ static getWaitCase(wxCore: WXCore): Promise; /** * 获取聊天记录 * @param wxCore * @param starttime 起始时间,unix时间戳 * @param endtime 结束时间,unix时间戳,每次查询时段不能超过24小时 * @param msgid 消息id顺序从小到大,从1开始 * @param number 每次获取条数,最多10000条 */ static getMsgRecord(wxCore: WXCore, starttime: number, endtime: number, msgid: number, num: number): Promise; }