Package io.manebot
Interface Bot
-
public interface Bot
-
-
Method Summary
Modifier and Type Method Description Version
getApiVersion()
Gets the API version of the bot.ChatDispatcher
getChatDispatcher()
Gets the system chat dispatcher.CommandDispatcher
getCommandDispatcher()
Gets the system command dispatcher.ConversationProvider
getConversationProvider()
Gets the system conversation provider.UserRegistration
getDefaultUserRegistration()
Gets the system default user registration handler.EventDispatcher
getEventDispatcher()
Gets the system command manager.default Platform
getPlatformById(java.lang.String id)
Finds a platform by its ID.java.util.Collection<Platform>
getPlatforms()
Gets a list of platforms registered to the system.PluginManager
getPluginManager()
Gets the plugin loader registryjava.util.Date
getStarted()
Gets the time at which the bot was started.BotState
getState()
Gets the state of the bot.Database
getSystemDatabase()
Gets the system database.UserManager
getUserManager()
Gets the system user manager.Version
getVersion()
Gets the version of the bot.default boolean
isRunning()
Gets if the bot is running.default boolean
isStopping()
Gets if the bot is stopping.boolean
registerStateListener(java.util.function.Consumer<BotState> listener)
Registers a state listener into the bot.void
start()
Starts the bot.void
stop()
Stops the bot.boolean
unregisterStateListener(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.IllegalAccessException
Starts 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.
-
-