Interface ChatChannel
- All Known Implementing Classes:
GroupChatChannel,PrivateChatChannel,SimpleChatChannel
public interface ChatChannel
Represents a chat channel that players can join, leave, and communicate in.
Channels are registered via
SocialRegistries.Channels.
Use builder(String, ChatFormatBuilder) to construct new instances.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumDetermines how a message is delivered to the recipients of this channel. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds the player with the given UUID to this channel.default booleanaddMember(@NotNull SocialUser user) Adds the given user to this channel.alias()Returns the mutable alias for this channel, if any.default StringReturns the alias if one is present, otherwise the channelname().static ChatChannelBuilderbuilder(@NotNull String name, @NotNull ChatFormatBuilder formatBuilder) Creates a newChatChannelbuilder.color()Returns the primary colour associated with this channel.commands()Returns the slash commands that switch a player into this channel.Returns a short description of this channel shown in menus.icon()Returns the icon component shown in menus for this channel.booleanReturnstrueif the player with the given UUID is a member of this channel.default booleanisMember(@NotNull SocialUser user) Returnstrueif the given user is a member of this channel.booleanReturnstrueif players are automatically added to this channel on join.members()Returns all users currently in this channel.name()Returns the unique name that identifies this channel.Returns the permission node required to see or write in this channel, if any.prefix(@NotNull SocialUser user, @NotNull SocialRegisteredMessageContext message, @NotNull SocialParserContext parser) Builds the rendered prefix shown before each message in this channel.booleanremoveMember(@NotNull UUID uuid) Removes the player with the given UUID from this channel.default booleanremoveMember(@NotNull SocialUser user) Removes the given user from this channel.Returns the renderer features that are active in this channel (e.g. replies, reactions).Returns an optional override colour applied to message text in this channel.
-
Method Details
-
builder
static ChatChannelBuilder builder(@NotNull @NotNull String name, @NotNull @NotNull ChatFormatBuilder formatBuilder) Creates a newChatChannelbuilder.- Parameters:
name- the unique identifier name for the channelformatBuilder- the format builder that defines the channel prefix- Returns:
- a new builder instance
-
name
Returns the unique name that identifies this channel. -
alias
Returns the mutable alias for this channel, if any. -
aliasOrName
Returns the alias if one is present, otherwise the channelname().- Returns:
- alias or name
-
commands
Returns the slash commands that switch a player into this channel. -
icon
Returns the icon component shown in menus for this channel. -
description
Returns a short description of this channel shown in menus. -
color
Returns the primary colour associated with this channel. -
permission
Returns the permission node required to see or write in this channel, if any. -
textColor
Returns an optional override colour applied to message text in this channel. -
joinByDefault
boolean joinByDefault()Returnstrueif players are automatically added to this channel on join. -
supportedRendererFeatures
Returns the renderer features that are active in this channel (e.g. replies, reactions). -
prefix
@NotNull @NotNull Component prefix(@NotNull @NotNull SocialUser user, @NotNull @NotNull SocialRegisteredMessageContext message, @NotNull @NotNull SocialParserContext parser) Builds the rendered prefix shown before each message in this channel.- Parameters:
user- the message sendermessage- the registered message contextparser- the parser context used for placeholder resolution- Returns:
- the rendered prefix component
-
addMember
Adds the player with the given UUID to this channel.- Parameters:
uuid- the player's UUID- Returns:
trueif the player was not already a member
-
addMember
Adds the given user to this channel.- Parameters:
user- the user to add- Returns:
trueif the user was not already a member
-
removeMember
Removes the player with the given UUID from this channel.- Parameters:
uuid- the player's UUID- Returns:
trueif the player was a member
-
removeMember
Removes the given user from this channel.- Parameters:
user- the user to remove- Returns:
trueif the user was a member
-
members
Returns all users currently in this channel.- Returns:
- the current members
-
isMember
Returnstrueif the player with the given UUID is a member of this channel.- Parameters:
uuid- the player UUID to check- Returns:
trueif the player is a member
-
isMember
Returnstrueif the given user is a member of this channel.- Parameters:
user- the user to check- Returns:
trueif the user is a member
-