Package tv.phantombot
Class PhantomBot
java.lang.Object
tv.phantombot.PhantomBot
- All Implemented Interfaces:
Listener
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOnly used on bot boot up for now.Current Build RevisionCurrent Version Of PhantomBot.boolean
checkDataStore
(String table, String key) Checks if a value is true in the datastore.boolean
checkModuleEnabled
(String module) Helper method to see if a module is enabled.void
command
(CommandEvent event) static void
End PhantomBot with an error statestatic void
exitOK()
End PhantomBot with an OK statestatic String
generateRandomString
(int length) gen a random stringstatic String
generateRandomString
(int length, boolean allowSpecial) Only used on bot boot up for now.Used by the panel on the informations tab.Method that returns the basic bot info.Tells you the bot name.Gives you the channel for that channelName.Gives you the current data storestatic boolean
static boolean
static boolean
static String
Deprecated, for removal: This API element is subject to removal in a future version.static boolean
Gives you the session for that channel.static boolean
static String
static ZoneId
getTMI()
Only used on bot boot up for now.void
handleCommand
(String username, String command) Handle commandsvoid
handleCommandSync
(String username, String command) Handle commandsboolean
Tells you if the discord token has been set.static PhantomBot
instance()
PhantomBot Instance.void
Connected to Twitch.boolean
Tells you if the bot is exitingstatic boolean
boolean
Tells you if the build is a nightly.boolean
Deprecated, for removal: This API element is subject to removal in a future version.This build type is not usedboolean
Check to see if YouTube Key is configured.static void
Load up mainvoid
onExit()
Used for exiting the botvoid
void
Current Repo Of PhantomBot.static void
setDebugging
(boolean debug) Enables or disables the debug mode.static void
setDebuggingLogOnly
(boolean debug) Enables or disables log only debug mode.static void
void
setSession
(TwitchSession session) void
setTwitchCacheReady
(boolean twitchCacheReady) Set the twitch cachevoid
Method to export a Java list to a csv file.void
-
Field Details
-
twitchCacheReady
public static boolean twitchCacheReady
-
-
Constructor Details
-
PhantomBot
public PhantomBot()Constructor for PhantomBot object.
-
-
Method Details
-
instance
PhantomBot Instance.- Returns:
- PhantomBot The current instance of PhantomBot
-
repoVersion
Current Repo Of PhantomBot.- Returns:
- String The current GitHub repository version of PhantomBot.
-
botVersion
Current Version Of PhantomBot.- Returns:
- String Display version of PhantomBot.
-
getBotInfo
Used by the panel on the informations tab.- Returns:
- String PhantomBot information for the Panel.
-
botRevision
Current Build Revision- Returns:
- String The build revision of PhantomBot.
-
getBotCreator
Only used on bot boot up for now.- Returns:
- bot creator
-
botDevelopers
Only used on bot boot up for now.- Returns:
- bot developers
-
getWebSite
Only used on bot boot up for now.- Returns:
- bot website
-
isYouTubeKeyEmpty
public boolean isYouTubeKeyEmpty()Check to see if YouTube Key is configured.- Returns:
-
setLevel
-
validateOAuth
public void validateOAuth() -
isNightly
public boolean isNightly()Tells you if the build is a nightly.- Returns:
-
isPrerelease
Deprecated, for removal: This API element is subject to removal in a future version.This build type is not usedTells you if the build is a pre-release. -
getAuthFlow
-
reconnect
public void reconnect() -
reloadProperties
public void reloadProperties() -
setDebugging
public static void setDebugging(boolean debug) Enables or disables the debug mode.- Parameters:
debug
-
-
setDebuggingLogOnly
public static void setDebuggingLogOnly(boolean debug) Enables or disables log only debug mode.- Parameters:
debug
-
-
getBotName
Tells you the bot name.- Returns:
- bot name
-
getHTTPPanelAndYTHandler
-
getHTTPOAuthHandler
-
getHTTPSetupHandler
-
getDataStore
Gives you the current data store- Returns:
- this.dataStore
-
isExiting
public boolean isExiting()Tells you if the bot is exiting- Returns:
- exit
-
getChannelName
Gives you the channel for that channelName.- Returns:
-
hasDiscordToken
public boolean hasDiscordToken()Tells you if the discord token has been set.- Returns:
-
getSession
Gives you the session for that channel.- Returns:
-
getTMI
- Returns:
- The
TwitchMessageInterface
for the IRC connection
-
checkModuleEnabled
Helper method to see if a module is enabled.- Parameters:
module
- Module name to check for- Returns:
- boolean If the module is enabled or not
-
getDataStoreType
-
checkDataStore
Checks if a value is true in the datastore.- Parameters:
table
- Db table to check.key
- Db key to check in that table.- Returns:
-
getBotInformation
Method that returns the basic bot info.- Returns:
-
getProperties
Deprecated, for removal: This API element is subject to removal in a future version.Please useCaselessProperties.instance()
insteadMethod that gets the PhantomBot properties.- Returns:
-
onExit
public void onExit()Used for exiting the bot -
command
-
ircJoinComplete
Connected to Twitch.- Parameters:
event
-
-
handleCommand
Handle commands- Parameters:
username
-command
-
-
handleCommandSync
Handle commands- Parameters:
username
-command
-
-
main
Load up main- Parameters:
args
-- Throws:
IOException
-
generateRandomString
gen a random string- Parameters:
length
-- Returns:
-
generateRandomString
-
getOsSuffix
-
setTwitchCacheReady
public void setTwitchCacheReady(boolean twitchCacheReady) Set the twitch cache- Parameters:
twitchCacheReady
-
-
toCSV
Method to export a Java list to a csv file.- Parameters:
headers
-values
-fileName
-
-
exitError
public static void exitError()End PhantomBot with an error state -
exitOK
public static void exitOK()End PhantomBot with an OK state -
getReloadScripts
public static boolean getReloadScripts() -
getSilentScriptsLoad
public static boolean getSilentScriptsLoad() -
getEnableDebugging
public static boolean getEnableDebugging() -
getEnableDebuggingLogOnly
public static boolean getEnableDebuggingLogOnly() -
getEnableRhinoDebugger
public static boolean getEnableRhinoDebugger() -
getTimeZone
-
getTimeZoneId
-
isInExitState
public static boolean isInExitState() -
setSession
-
panelhandler
-
CaselessProperties.instance()
instead