Class ChannelAudience

java.lang.Object
dev.unnm3d.redischat.api.objects.ChannelAudience
Direct Known Subclasses:
Channel

public class ChannelAudience extends Object
  • Field Details

    • type

      protected AudienceType type
    • name

      protected final String name
    • proximityDistance

      protected int proximityDistance
    • permissions

      protected List<String> permissions
  • Constructor Details

    • ChannelAudience

      public ChannelAudience(AudienceType type, String name, String... permissions)
      Constructor without 'local' field
      Parameters:
      type - The type of the audience, represented by the AudienceType enum
      name - The name of the audience
      permissions - A varargs parameter representing the permissions of the audience
    • ChannelAudience

      public ChannelAudience(String channelName, String... permissions)
      Constructor without 'permission' and 'local' fields
      Parameters:
      channelName - The name of the channel
      permissions - A varargs parameter representing the permissions of the audience
    • ChannelAudience

      public ChannelAudience()
      Default constructor

      This constructor initializes the audience with the SERVER_SENDER name, SYSTEM type, and no permissions.

  • Method Details

    • newPlayerAudience

      public static ChannelAudience newPlayerAudience(String playerName)
      Constructor for building a player audience
      Parameters:
      playerName - The name of the player
    • newDiscordAudience

      public static ChannelAudience newDiscordAudience(String authorUsername)
      Constructor for building a discord audience
      Parameters:
      authorUsername - The discord username of the audience
    • publicChannelAudience

      public static ChannelAudience publicChannelAudience(String... permissions)
      Constructor for building a public channel audience
    • isPlayer

      public boolean isPlayer()
      Checks if the audience is a player
      Returns:
      True if the audience is a player, false otherwise
    • isServer

      public boolean isServer()
      Checks if the audience is the server
      Returns:
      True if the audience is the server, false otherwise
    • isChannel

      public boolean isChannel()
      Checks if the audience is a channel
      Returns:
      True if the audience is a channel, false otherwise
    • isDiscord

      public boolean isDiscord()
      Checks if the audience is a discord channel
      Returns:
      True if the audience is a discord channel, false otherwise
    • builder

      public static ChannelAudience.ChannelAudienceBuilder builder(String name)