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
Modifier and TypeFieldDescriptionstatic int
static boolean
static boolean
static boolean
static boolean
static boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Checks the command against the blacklist, unless force commands is enabled.static void
static boolean
Attempts to parse and then execute a command.static boolean
doCommandMultiplayer(String message, String sender)
Attempts to run a command for every player in the affected players list.static void
Picks 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()
-