Skip to content

直播间互动消息推送

支持协议

  • websocket
  • socketIo

推送socketio-event

message

推送参数

其他默认推送参数文档,参考websocket-使用说明
参数必选类型描述
typestring消息类型:event-事件
eventstring事件类型 :pushChatMsg--直播间互动推送
dataobject消息内容

data 参数结构

参数必选类型描述
chat_idstring互动记录id
room_idstring直播间id
room_namestring直播间名称
wechat_user_space_idstring用户ID
namestring用户昵称
photostring用户头像
chat_typestring互动类型:speak-文本
chat_contentstring互动内容,json的字符串。
send_timeint互动发送时间。

chat_content 参数结构

使用前先json解析

参数必选类型描述
contentstring互动文本内容

推送示例

{
    "msg_id": "EAxxx6BCA728D42",
    "type": "event",
    "event": "pushChatMsg",
    "uid": xxx,
    "data": {
        "chat_id": "xxx-712F-0880-xx-xx",
        "uid": xx,
        "room_id": xx,
        "wechat_user_space_id": "xx",
        "name": "张xxx兰",
        "photo": "https://xx.oss.nuoyun.tv/Uploads/xxxx.jpg",
        "chat_type": "speak",
        "chat_content": "{\"content\":\"666\"}",
        "send_time": 1701669903,
        "room_name": "xxxxx"
    }
}