Polyv Help Center

Help Center

Chat Room Module

Updated: 2026-01-19 09:16:42
  • 聊天室模块(chat) is a module serving the Polyv chat room service, including functions such as retrieving and sending chat room messages, user login/logout in the chat room, and obtaining the online user list.
  • This module is implemented based on Polyv's 聊天室SDK and communicates between the client and server via WebSocket.

1. API Method Overview

API Method Description
getSocket Get the chat room socket instance
setChatHistoryEncrypt Set whether chat history messages are encrypted
getChatInfo Get chat room information
getChatSetting Get chat room settings
getChatHistory Get chat history messages
getChatHistoryBySessionId Paginate chat history messages by session ID
getChatHistoryByTime Get chat history messages by timestamp
getRealtimeLikes Get real-time like count
sendLike Send a like
sendEmotionalFeedback Send emotional feedback
sendSpeakMsg Send a text message
sendImageMsg Send an image message
sendEmotionImageMsg Send an emoji image message
sendSystemMsg Send a system message
sendCustomMessage Send a custom message (client)
insertLocalRewardChatMsg Insert a local reward chat message
getFullMessage Get the full text of an extra-long message
startOnlineUserListPolling Start online user list polling
stopOnlineUserListPolling Stop online user list polling
getOnlineUserListNew Get online user list (new API)
getOnlineUserCount Get the real-time online user count in the chat room
parseSpeakContent Parse message content
getChatMsgReplayHistoryList Get chat message replay history data
processChatMsgReplay Process chat message replay
initChatMsgReplay Initialize chat message replay
addChatMsgReplayCachePlugin Add a chat replay local cache plugin
removeChatMsg Remove a chat message by ID
replaceChatMsg Replace chat content by ID
getSpeakTopInfo Get comment pinning data
setSpeakTop Set comment pinning data
cancelSpeakTop Cancel comment pinning
getChatCustomIntroductionText Get the notification text for the chat area
getChannelFileList Get the channel file list

2. Event Overview

Event Description
ChatEvents.ChatSdkV2Setuped Callback when the V2 chat room SDK setup is complete
ChatEvents.ChatInfoChange Chat room information modification
ChatEvents.ChatReconnectSuccess Chat room reconnection success event
ChatEvents.ChatConnectFail Chat room connection failure event
ChatEvents.ChatMessage Chat message event
ChatEvents.ReplaceChatMessage Replace chat message event
ChatEvents.ChatLike Like event
ChatEvents.ChatLikeCountChange Like count change event
ChatEvents.ChatEmotionalFeedback Emotional feedback event
ChatEvents.ChatUserLogin Chat room user login event
ChatEvents.ChatUserLogout Chat room user logout event
ChatEvents.CurrentUserRelogin Current user re-login event
ChatEvents.ClearMsgHistory Clear chat room event
ChatEvents.RemoveChatMsg Remove a specific message event
ChatEvents.CloseChatRoom Chat room close event
ChatEvents.OpenChatRoom Chat room open event
ChatEvents.OnlineUserCountChange Online user count change event
ChatEvents.OnlineUserListChange Online user list change event
ChatEvents.ChatMsgReplayReload Chat message replay - reload
ChatEvents.ChatMsgReplayStatusChange Chat message replay status
ChatEvents.OverMaxOnlineCount Exceeded maximum online users in the live room
ChatEvents.WhiteListRemoveUser Whitelist user removal
ChatEvents.SpeakToTop Comment pinning event
ChatEvents.SpeakCancelTop Comment unpinning event
ChatEvents.OverLoginLimit Exceeded channel login limit event
联系客服,在线咨询