微信小程序客服消息使用云函数处理,
// 云函数入口文件
const cloud = require(‘wx-server-sdk’)
cloud.init()
// 云函数入口函数
exports.main = async (event, context) => {
const wxContext = cloud.getWXContext()
await cloud.openapi.customerServiceMessage.send({
touser: wxContext.OPENID,
msgtype: ‘text’,
text: {
content: event.SessionFrom,
},
})
return {
MsgType: ‘transfer_customer_service’,
ToUserName: ‘touser’,
FromUserName: ‘fromuser’,
CreateTime: parseInt(+new Date / 1000),
}
}
云函数接收消息并返回消息并转发,想问一下这个转发是否只能转发到网页版客服,而小程序客服接收不到转发的信息?
目前网页版客服正在维护,无法测试