代码位置:https://leancloud.cn/docs/realtime-guide-systemconv.html#hash-1573260517
代码内容:
@engine.define
def _messageReceived(**params):
print('_messageReceived start')
content = json.loads(params['content'])
text = content._lctext
print('text:', text)
processed_content = text.replace('XX 传奇', '**')
print('_messageReceived end')
# 必须含有以下语句给服务端一个正确的返回,否则会引起异常
return {
'content': processed_content,
}
错误描述:
text = content._lctext这句有错误
修改这个错误后,所有发送的消息接收到的都是undefined
通过print可以看到processed_content是正确的内容