Package top.focess.qq.core.bot
Class SimpleBotManager
- java.lang.Object
-
- top.focess.qq.core.bot.SimpleBotManager
-
- All Implemented Interfaces:
BotManager
public class SimpleBotManager extends Object implements BotManager
-
-
Constructor Summary
Constructors Constructor Description SimpleBotManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BotgetBot(long username)Get the bot with special idList<Bot>getBots()Get the list of botsFuture<Bot>login(long id, String password)Login and get the bot with id and passwordbooleanlogin(Bot bot)Login the botBotloginDirectly(long id, String password)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 botstatic voidremoveAll()
-
-
-
Method Detail
-
login
@NotNull public Future<Bot> login(long id, String password)
Description copied from interface:BotManagerLogin and get the bot with id and password- Specified by:
loginin interfaceBotManager- Parameters:
id- the id of the botpassword- the password of the bot- Returns:
- the bot
-
loginDirectly
@NotNull public Bot loginDirectly(long id, String password)
Description copied from interface:BotManagerLogin and get the bot with id and password This is a blocking method- Specified by:
loginDirectlyin interfaceBotManager- Parameters:
id- the id of the botpassword- the password of the bot- Returns:
- the bot
-
login
public boolean login(Bot bot)
Description copied from interface:BotManagerLogin the bot- Specified by:
loginin interfaceBotManager- Parameters:
bot- the bot need to log in- Returns:
- true if the bot is not online, false otherwise
-
logout
public boolean logout(@NotNull Bot bot)Description copied from interface:BotManagerLogout the bot- Specified by:
logoutin interfaceBotManager- Parameters:
bot- the bot need to log out- Returns:
- true if the bot is online, false otherwise
-
getBot
@Nullable public Bot getBot(long username)
Description copied from interface:BotManagerGet the bot with special id- Specified by:
getBotin interfaceBotManager- Parameters:
username- the id of the bot- Returns:
- the bot with special id
-
relogin
public boolean relogin(@NotNull Bot bot)Description copied from interface:BotManagerRelogin the bot- Specified by:
reloginin interfaceBotManager- Parameters:
bot- the bot need to relogin- Returns:
- true if the bot is online, false otherwise
-
getBots
public List<Bot> getBots()
Description copied from interface:BotManagerGet the list of bots- Specified by:
getBotsin interfaceBotManager- Returns:
- the list of bots
-
remove
public Bot remove(long id)
Description copied from interface:BotManagerRemove the bot- Specified by:
removein interfaceBotManager- Parameters:
id- the bot id- Returns:
- the previous bot
-
removeAll
public static void removeAll()
-
-