Package io.manebot
Interface Bot
-
public interface Bot
-
-
Method Summary
Modifier and Type Method Description VersiongetApiVersion()Gets the API version of the bot.ChatDispatchergetChatDispatcher()Gets the system chat dispatcher.CommandDispatchergetCommandDispatcher()Gets the system command dispatcher.ConversationProvidergetConversationProvider()Gets the system conversation provider.UserRegistrationgetDefaultUserRegistration()Gets the system default user registration handler.EventDispatchergetEventDispatcher()Gets the system command manager.default PlatformgetPlatformById(java.lang.String id)Finds a platform by its ID.java.util.Collection<Platform>getPlatforms()Gets a list of platforms registered to the system.PluginManagergetPluginManager()Gets the plugin loader registryjava.util.DategetStarted()Gets the time at which the bot was started.BotStategetState()Gets the state of the bot.DatabasegetSystemDatabase()Gets the system database.UserManagergetUserManager()Gets the system user manager.VersiongetVersion()Gets the version of the bot.default booleanisRunning()Gets if the bot is running.default booleanisStopping()Gets if the bot is stopping.booleanregisterStateListener(java.util.function.Consumer<BotState> listener)Registers a state listener into the bot.voidstart()Starts the bot.voidstop()Stops the bot.booleanunregisterStateListener(java.util.function.Consumer<BotState> listener)Unregisters a state listener from the bot.
-
-
-
Method Detail
-
getVersion
Version getVersion()
Gets the version of the bot.- Returns:
- Version.
-
getApiVersion
Version getApiVersion()
Gets the API version of the bot.- Returns:
- API Version.
-
getPlatforms
java.util.Collection<Platform> getPlatforms()
Gets a list of platforms registered to the system.- Returns:
- list of Platforms.
-
getPlatformById
default Platform getPlatformById(java.lang.String id)
Finds a platform by its ID.- Parameters:
id- Platform ID to find.- Returns:
- Platform instance if a platform is found, null otherwise.
-
getDefaultUserRegistration
UserRegistration getDefaultUserRegistration()
Gets the system default user registration handler.- Returns:
- default user registration instance.
-
getState
BotState getState()
Gets the state of the bot.- Returns:
- Bot state.
-
isRunning
default boolean isRunning()
Gets if the bot is running.- Returns:
- true if the bot is running, false otherwise.
-
isStopping
default boolean isStopping()
Gets if the bot is stopping.- Returns:
- true if the bot is stopping, false otherwise.
-
getSystemDatabase
Database getSystemDatabase()
Gets the system database.- Returns:
- System database.
-
getStarted
java.util.Date getStarted()
Gets the time at which the bot was started.- Returns:
- Bot startup date.
-
getPluginManager
PluginManager getPluginManager()
Gets the plugin loader registry- Returns:
- plugin loader registry.
-
getEventDispatcher
EventDispatcher getEventDispatcher()
Gets the system command manager.- Returns:
- command manager.
-
getCommandDispatcher
CommandDispatcher getCommandDispatcher()
Gets the system command dispatcher.- Returns:
- command dispatcher.
-
getChatDispatcher
ChatDispatcher getChatDispatcher()
Gets the system chat dispatcher.- Returns:
- chat dispatcher.
-
getUserManager
UserManager getUserManager()
Gets the system user manager.- Returns:
- user manager.
-
getConversationProvider
ConversationProvider getConversationProvider()
Gets the system conversation provider.- Returns:
- conversation provider.
-
start
void start() throws java.lang.IllegalAccessExceptionStarts the bot.- Throws:
java.lang.IllegalAccessException- if the caller does not have the appropriate permission.
-
stop
void stop() throws java.lang.IllegalAccessException
Stops the bot.- Throws:
java.lang.IllegalAccessException- if the caller does not have the appropriate permission.
-
registerStateListener
boolean registerStateListener(java.util.function.Consumer<BotState> listener)
Registers a state listener into the bot.- Parameters:
listener- state listener instance.- Returns:
- true if the listener was registered, false otherwise.
-
unregisterStateListener
boolean unregisterStateListener(java.util.function.Consumer<BotState> listener)
Unregisters a state listener from the bot.- Parameters:
listener- state listener instance.- Returns:
- true if the listener was removed, false otherwise.
-
-