Constructors
constructor
- new ChatroomManager(roomManager): ChatroomManager
Parameters
- roomManager: EMChatroomManager
Methods
addChatroomAdmin
- addChatroomAdmin(roomId, newAdmin): Promise<Chatroom>
Parameters
- roomId: string
- newAdmin: string
Returns Promise<Chatroom>
addListener
- addListener(listener): void
Returns void
。
addToChatroomWhitelist
- addToChatroomWhitelist(roomId, members): Promise<Chatroom>
Parameters
- roomId: string
- members: string[]
Returns Promise<Chatroom>
blockChatroomMembers
- blockChatroomMembers(roomId, members): Promise<Chatroom>
Parameters
- roomId: string
- members: string[]
Returns Promise<Chatroom>
changeChatroomAnnouncement
- changeChatroomAnnouncement(roomId, newAnnouncement): Promise<Chatroom>
Parameters
- roomId: string
- newAnnouncement: string
Returns Promise<Chatroom>
changeChatroomDescription
- changeChatroomDescription(roomId, newDescription): Promise<Chatroom>
Parameters
- roomId: string
- newDescription: string
Returns Promise<Chatroom>
changeChatroomName
- changeChatroomName(roomId, newName): Promise<Chatroom>
Parameters
- roomId: string
- newName: string
Returns Promise<Chatroom>
changeChatroomOwner
- changeChatroomOwner(roomId, newOwner): Promise<Chatroom>
Parameters
- roomId: string
- newOwner: string
Returns Promise<Chatroom>
checkIfInMutelist
- checkIfInMutelist(roomId): Promise<boolean>
Returns Promise<boolean>
checkIfInWhitelist
- checkIfInWhitelist(roomId): Promise<boolean>
Returns Promise<boolean>
fetchChatroomAnnouncement
- fetchChatroomAnnouncement(roomId): Promise<string>
Returns Promise<string>
fetchChatroomAttributes
- fetchChatroomAttributes(chatroomId, key?): Promise<Map<string, string>>
Parameters
- chatroomId: string
Optional
key: string | string[]
Returns Promise<Map<string, string>>
fetchChatroomBlocklist
- fetchChatroomBlocklist(roomId, pageNum, pageSize): Promise<string[]>
Parameters
- roomId: string
- pageNum: number
- pageSize: number
Returns Promise<string[]>
fetchChatroomMembers
- fetchChatroomMembers(roomId, cursor, pageSize): Promise<CursorResult<string>>
Parameters
- roomId: string
- cursor: string
- pageSize: number
Returns Promise<CursorResult<string>>
fetchChatroomMutes
- fetchChatroomMutes(roomId, pageNum, pageSize): Promise<Map<string, number>>
Parameters
- roomId: string
- pageNum: number
- pageSize: number
Returns Promise<Map<string, number>>
- Map 中内容为成员的用户 ID 和禁言时长,单位为毫秒。
fetchChatroomWhitelist
- fetchChatroomWhitelist(roomId): Promise<string[]>
Returns Promise<string[]>
fetchPublicChatroomsFromServer
- fetchPublicChatroomsFromServer(pageNum, pageSize): Promise<Chatroom[]>
Parameters
- pageNum: number
- pageSize: number
Returns Promise<Chatroom[]>
joinChatroom
- joinChatroom(roomId, leaveOtherRooms?, ext?): Promise<Chatroom>
Parameters
- roomId: string
- leaveOtherRooms: boolean = false
- ext: string = ""
Returns Promise<Chatroom>
leaveChatroom
- leaveChatroom(roomId): Promise<void>
Returns Promise<void>
muteChatroomMembers
- muteChatroomMembers(roomId, members, muteDuration): Promise<Chatroom>
Parameters
- roomId: string
- members: string[]
- muteDuration: number
Returns Promise<Chatroom>
removeChatroomAdmin
- removeChatroomAdmin(roomId, admin): Promise<Chatroom>
Parameters
- roomId: string
- admin: string
Returns Promise<Chatroom>
removeChatroomMembers
- removeChatroomMembers(roomId, members): Promise<Chatroom>
Parameters
- roomId: string
- members: string[]
Returns Promise<Chatroom>
removeFromChatroomWhitelist
- removeFromChatroomWhitelist(roomId, members): Promise<Chatroom>
Parameters
- roomId: string
- members: string[]
Returns Promise<Chatroom>
removeListener
- removeListener(listener): void
Returns void
。
unblockChatroomMembers
- unblockChatroomMembers(roomId, members): Promise<Chatroom>
Parameters
- roomId: string
- members: string[]
Returns Promise<Chatroom>
unmuteChatroomMembers
- unmuteChatroomMembers(roomId, members): Promise<Chatroom>
Parameters
- roomId: string
- members: string[]
Returns Promise<Chatroom>
添加聊天室管理员。