调用方式:
chatroom.chatroomMsg.sendTextMsg(options)
根据标签查询历史消息
const msgs = chatroom.chatroomMsg.getHistoryMsgsByTags({ tags: ['tag1', 'tag2'], types: ['text', 'image', 'audio', 'video'], limit: 100, // 从较晚的消息开始查找 reverse: 1})
查询历史消息
const msgs = chatroom.chatroomMsg.queryMessageHistory({ // 单次最多查询 100 条消息 limit: 100, // 升序查询。从最早的消息开始查询 reverse: true})
发送音频消息(包含上传文件的功能)
chatroom.chatroomMsg.sendAudioMsg({ "file": audioFile})
发送自定义消息
chatroom.chatroomMsg.sendCustomMsg({ "body": "custom"})
发送其他文件消息(包含上传文件的功能)
chatroom.chatroomMsg.sendFileMsg({ "file": file})
发送地理位置消息
chatroom.chatroomMsg.sendGeoLocationMsg({ body: { lng: 120, lat: 30.2, title: 'location title', }})
发送图片消息(包含上传文件的功能)
chatroom.chatroomMsg.sendImageMsg({ "file": imgFile})
发送文本消息
chatroom.chatroomMsg.sendTextMsg({ body: 'hello'})
发送提醒消息
提醒消息用于会话内的状态提醒,如进入会话时出现的欢迎消息,或者会话命中敏感词后的提示消息等等.
chatroom.chatroomMsg.sendTipMessage({ body: 'tip'})
发送视频消息(包含上传文件的功能)
chatroom.chatroomMsg.sendVideoMsg({ "file": videoFile})
调用方式: