ChannelMembershipManager

Constructors

Link copied to clipboard
constructor(channelManager: ChannelManager, logger: Logger, config: ChannelChatFeatureConfig)

Functions

Link copied to clipboard
fun getMemberRole(playerId: UUID, channelId: String): Result<ChannelRole>

Gets the role of a member in a channel.

Link copied to clipboard
fun getMemberRoleOrNull(playerId: UUID, channelId: String): ChannelRole?

Gets the role of a member in a channel without throwing exceptions.

Link copied to clipboard

Gets all channels where the player is a member.

Link copied to clipboard
fun hasRole(playerId: UUID, channelId: String, requireRole: ChannelRole): Result<Boolean>

Checks if a player has a specific role or higher in a channel.

Link copied to clipboard
fun isMember(playerId: UUID, channelId: String): Result<Boolean>

Checks if a player is a member of a channel.

Link copied to clipboard
fun joinChannel(playerId: UUID, channelId: String, bypassPrivateCheck: Boolean = false): Result<Unit>

Adds a player to a channel as a member and sets it as their active channel. If the player is already a member of other channels, they remain members of those channels. Only one channel can be active at a time.

Link copied to clipboard
fun leaveChannel(playerId: UUID): Result<Unit>

Removes the player from the active channel completely. The player will be removed from the channel membership and the active channel will be cleared.

Link copied to clipboard
fun switchChannel(playerId: UUID, channelId: String): Result<Unit>

Switches the player's active channel to a channel they are already a member of.