Class ChatPicker
java.lang.Object
io.github.icrazyblaze.twitchmod.chat.ChatPicker
This class is responsible for picking commands from chat and running them.
- See Also:
ChatCommands
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intstatic booleanstatic booleanstatic booleanstatic booleanstatic boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidChecks the command against the blacklist, unless force commands is enabled.static voidstatic booleanAttempts to parse and then execute a command.static booleandoCommandMultiplayer(String message, String sender)Attempts to run a command for every player in the affected players list.static voidPicks a random chat message, and checks if it is a command.
-
Field Details
-
chatBuffer
-
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
-
chatLogLength
public static int chatLogLength
-
-
Constructor Details
-
ChatPicker
public ChatPicker()
-
-
Method Details
-
checkChat
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 messagesender- The sender's name
-
doCommandMultiplayer
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
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()
-