Package top.focess.qq.api.bot
Interface BotManager
-
- All Known Implementing Classes:
SimpleBotManager
public interface BotManagerThis class is used to manage all the bots.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BotgetBot(long id)Get the bot with special idList<Bot>getBots()Get the list of botsFuture<Bot>login(long id, String password, Plugin plugin)Login and get the bot with id and passwordbooleanlogin(Bot bot)Login the botBotloginDirectly(long id, String password, Plugin plugin)Login and get the bot with id and password This is a blocking methodbooleanlogout(Bot bot)Logout the botbooleanrelogin(Bot bot)Relogin the botBotremove(long id)Remove the bot
-
-
-
Method Detail
-
login
@NotNull Future<Bot> login(long id, String password, Plugin plugin)
Login and get the bot with id and password- Parameters:
id- the id of the botpassword- the password of the botplugin- the plugin- Returns:
- the bot
-
loginDirectly
@NotNull Bot loginDirectly(long id, String password, Plugin plugin) throws BotLoginException
Login and get the bot with id and password This is a blocking method- Parameters:
id- the id of the botpassword- the password of the botplugin- the plugin- Returns:
- the bot
- Throws:
BotLoginException- if the bot login failed
-
login
boolean login(Bot bot) throws BotLoginException
Login the bot- Parameters:
bot- the bot need to log in- Returns:
- true if the bot is not online, false otherwise
- Throws:
BotLoginException- if the bot login failed
-
logout
boolean logout(@NotNull Bot bot)Logout the bot- Parameters:
bot- the bot need to log out- Returns:
- true if the bot is online, false otherwise
-
getBot
@Nullable Bot getBot(long id)
Get the bot with special id- Parameters:
id- the id of the bot- Returns:
- the bot with special id
-
relogin
boolean relogin(@NotNull Bot bot) throws BotLoginExceptionRelogin the bot- Parameters:
bot- the bot need to relogin- Returns:
- true if the bot is online, false otherwise
- Throws:
BotLoginException- if the bot login failed
-
remove
Bot remove(long id)
Remove the bot- Parameters:
id- the bot id- Returns:
- the previous bot
-
-