Class ChatPicker

java.lang.Object
io.github.icrazyblaze.twitchmod.chat.ChatPicker

public class ChatPicker extends Object
This class is responsible for picking commands from chat and running them.
See Also:
ChatCommands
  • Field Details

    • chatBuffer

      public static ArrayList<String> chatBuffer
    • chatSenderBuffer

      public static ArrayList<String> chatSenderBuffer
    • cooldownEnabled

      public static boolean cooldownEnabled
    • forceCommands

      public static boolean forceCommands
    • instantCommands

      public static boolean instantCommands
    • enabled

      public static boolean enabled
    • logMessages

      public static boolean logMessages
    • tempChatLog

      public static ArrayList<String> tempChatLog
    • chatLogLength

      public static int chatLogLength
  • Constructor Details

    • ChatPicker

      public ChatPicker()
  • Method Details

    • checkChat

      public static void checkChat(String message, String sender)
      Checks the command against the blacklist, unless force commands is enabled. If the chat should be logged for writing into a book then that is also done here.
      Parameters:
      message - The chat message
      sender - The sender's name
    • doCommandMultiplayer

      public static boolean doCommandMultiplayer(String message, String sender)
      Attempts to run a command for every player in the affected players list.
      Parameters:
      message - The chat command, e.g. "!creeper"
      sender - The sender's name, which is used in some commands.
      Returns:
      If the command doesn't run, then this method returns false.
      Since:
      3.5.0
    • doCommand

      public static boolean doCommand(String message, String sender)
      Attempts to parse and then execute a command.
      Parameters:
      message - The chat command, e.g. "!creeper"
      sender - The sender's name, which is used in some commands.
      Returns:
      If the command doesn't run, then this method returns false.
    • pickRandomChat

      public static void pickRandomChat()
      Picks a random chat message, and checks if it is a command. If the chat message is a command, it will be run. Otherwise, a new message is picked.
    • commandFailed

      public static void commandFailed()