Adds members to the allow list of the chat room. Members added to the allow list of the chat room will receive in onChatroomEvent callback operation: 'addUserToAllowlist'.
connection.addUsersToChatRoomAllowlist({chatRoomId: 'chatRoomId'})
The chat room ID.
The members to be added to the allow list.
Adds a member to the the block list of the chat room. Only the chat room owner or admin can call this method.
connection.blockChatRoomMember({chatRoomId: 'chatRoomId', username: 'user1'})
The chat room ID.
The member to be added to the block list.
Adds members to the block list of the chat room. Only the chat room owner or admin can call this method.
connection.blockChatRoomMembers({usernames: ['user1', 'user2'], chatRoomId: 'chatRoomId'})
The chat room ID.
The members to be added to the block list.
Creates a chat room.
connection.createChatRoom({name: 'myChatRoom', description: 'this is my chatroom', maxusers: 200, members: ['user1'], token: 'your token'})
The description of the chat room.
The maximum number of members in the chat room, including the chat room creator. The value is an integer in the range of [1,5000], with 200 as the default.
(Optional) The members in the chat room. An array of user IDs of members. If you set this parameter, ensure that the array contains at least one user ID.
The chat room name.
The super admin token.
Deletes a shared file of the chat room.
connection.deleteChatRoomSharedFile({roomId: 'roomId', fileId: 'fileId'})
The shared file ID.
The chat room ID.
Destroys the chat room.
connection.destroyChatRoom({chatRoomId: 'chatRoomId', token: 'your token'})
The chat room ID
The super admin token.
Mutes all the members in the chat room. Only the chat room owner or admin can call this method. Chat room members will receive the muteAllMembers event.
connection.disableSendChatRoomMsg({chatRoomId: 'chatRoomId'})
The chat room ID.
Unmutes all the members in the chat room.
Only the chat room owner or admin can call this method.
The chat room members will receive the unmuteAllMembers
event.
connection.enableSendChatRoomMsg({chatRoomId: 'chatRoomId'})
The chat room ID.
Gets the announcement of the chat room.
connection.fetchChatRoomAnnouncement({roomId: 'roomId'})
The chat room ID.
Gets all admins of the chat room.
connection.getChatRoomAdmin({chatRoomId: 'chatRoomId'})
The chat room ID.
Gets the allow list of the chat room.
Only the chat room owner or admin can call this method.
connection.getChatRoomWhitelist({chatRoomId: 'chatRoomId'})
The chat room ID.
Gets all of the chat room custom attributes.
connection.getChatRoomAttributes({chatRoomId: 'chatRoomId', attributes:["attributeKey1","attributeKey2"]})
The custom attribute to get. If you pass the attribute key, the SDK returns the attribute value. If you set it as null, the SDK returns all the attributes value.
The chat room ID.
Gets the block list of the chat room.
connection.getChatRoomBlocklist({chatRoomId: 'chatRoomId'})
The chat room ID.
Gets specifications of the chat room.
connection.getChatRoomDetails({chatRoomId: 'chatRoomId'})
The chat room ID.
Gets all muted members in the chat room.
connection.getChatRoomMutelist({chatRoomId: 'chatRoomId'})
The chat room ID.
Gets the list of shared files in the chat room.
connection.getChatRoomSharedFilelist({roomId: 'roomId'})
The chat room ID
Gets the chat room list with pagination.
connection.getChatRooms({pagenum: 1, pagesize: 20})
The page number, starting from 1.
The number of chat rooms that you expect to get on each page. The default value is 20.
Gets the list of chat rooms that a user has joined.
connection.getJoinedChatRooms({pageNum: 1, pageSize: 20})
The page number, starting from 1.
The number of chat rooms to get per page. The value cannot exceed 500.
Checks whether chat room members are on the allow list.
Only the chat room owner or admin can call this method. The chat room members can check themselves.
connection.isInChatRoomAllowlist({chatRoomId: 'chatRoomId', userName: 'user1'})
The chat room ID.
The member ID.
Check whether you are on the chat room mute list.
connection.isInChatRoomMutelist({chatRoomId: 'chatRoomId'})
The chat room ID.
Joins the chat room.
Extension fields carried when joining a chat room.
Whether to leave all the currently joined chat rooms when joining a chat room.
true
: The user joins the chat room, while leaving all other chat rooms.false
: The user joins the chat room, without leaving all other chat rooms.The reason for joining the chat room. This parameter does not take effect. You can ignore it.
The chat room ID.
Exits the chat room.
The chat room ID.
Lists all chat room members with pagination.
connection.listChatRoomMembers({pageNum: 1, pageSize: 20, chatRoomId: 'chatRoomId'})
The chat room ID.
The page number, starting from 1.
The number of members that you expect to get on each page. The value range is [1,1000].
Modifies the specifications of the chat room.
connection.modifyChatRoom({chatRoomId: 'chatRoomId', chatRoomName: 'chatRoomName', description: 'description', maxusers: 5000})
The chat room ID.
The chat room name.
The description of the chat room.
The maximum number of members in the chat room.
Mutes chat room member.
The chat room ID.
The mute duration in milliseconds. The value -1
indicates that the member is muted permanently.
The member to be muted in the chat room.
Removes chat room admins.
The chat room ID.
The admins to be removed.
Removes members from the allow list of the chat room. Only the chat room owner or admin can call this method. The users who are removed will receive "operation:'removeAllowlistMember'" in the callback of onChatroomEvent..
connection.removeChatRoomAllowlistMember({chatRoomId: 'chatRoomId', userName: 'user1'})
The chat room ID.
The members to be removed from the allow list.
Removes a chat room attribute.
connection.removeChatRoomAttributes({chatRoomId: 'chatRoomId', attributeKeys: ['string1','string2'], isForced: boolean })
The key of the chat room attribute to delete.
The chat room ID.
Whether to allow a member to overwrite any chat room attribute set by any member.
true
: Yes;false
: No.Removes custom chat room attributes.
connection.removeChatRoomAttributes({chatRoomId: 'chatRoomId', attributeKeys: ['attributeKey1','attributeKey2'], isForced: false })
The array of keys of attributes to remove. The array can contain a maximum number of 10 attribute keys.
The chat room ID.
Whether to allow chat room members to overwrite the chat room attributes set by others.
true
: Yes;false
: No.Removes a chat room member.
connection.removeChatRoomMember({chatRoomId: 'chatRoomId', username: 'username'})
The chat room ID.
The member to be removed.
Sets a member as the chat room admin.
The chat room ID.
The members to be set as admin.
Sets a custom chat room attribute.
connection.setChatroomAttribute({chatRoomId: 'chatRoomId', attributeKey: "attributeKey1", attributeValue: "attributeValue1", autoDelete: true, isForced: false})
The chat room attribute key. A single key cannot exceed 128 characters; the total number of keys in a chat room cannot exceed 100. The following character sets are supported:
The chat room attribute value. The attribute value can contain a maximum of 4096 characters. The total length of custom chat room attributes cannot exceed 10 GB for each app.
Whether to delete chat room attributes set by the member when he or she exits the chat room.
true
: Yes;false
: No.The chat room ID.
Whether to delete chat room attributes set by the member when he or she exits the chat room.
true
: Yes;false
: No.Sets the chat room attributes in batches.
connection.setChatRoomAttributes({chatRoomId: 'chatRoomId', attributes: {"attributeKey1": "attributeValue1"}, autoDelete: true, isForced: false})
The map of custom chat room attributes.
Whether to delete chat room attributes set by the member when he or she exits the chat room. - (Default)true
: Yes. - false
: No.
The chat room ID.
Whether to allow a member to overwrite the chat room attribute set by another member. - true
: Yes. -(Default)false
: No.
Removes a member from the the block list of the chat room.
The chat room ID.
The member to be removed from the block list.
Removes members from the block list of the chat room. Only the chat room owner or admin can call this method.
connection.unblockChatRoomMembers({chatRoomId: 'chatRoomId', usernames: ['user1', 'user2']})
The chat room ID.
The array of members to be removed from the block list.
Unmutes the chat room member.
The chat room ID.
The member to be unmuted.
Updates the announcement of the chat room.
connection.updateChatRoomAnnouncement({roomId: 'roomId', announcement: 'hello'})
The announcement content.
The chat room ID.
Uploads a shared file to the chat room.
connection.uploadChatRoomSharedFile({roomId: 'roomId', file: 'file object', onFileUploadProgress: onFileUploadProgress, onFileUploadComplete: onFileUploadComplete,onFileUploadError:onFileUploadError,onFileUploadCanceled:onFileUploadCanceled})
The shared file object to upload.
The chat room ID.
The upload cancellation callback.
The upload completion callback.
The upload failure callback.
The upload progress callback.
Generated using TypeDoc
Chatroom contains APIs for chatroom-related operations.