Interface BotManager

  • All Known Implementing Classes:
    SimpleBotManager

    public interface BotManager
    This class is used to manage all the bots.
    • 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 bot
        password - the password of the bot
        plugin - 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 bot
        password - the password of the bot
        plugin - 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 BotLoginException
        Relogin 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
      • getBots

        List<Bot> getBots()
        Get the list of bots
        Returns:
        the list of bots
      • remove

        Bot remove​(long id)
        Remove the bot
        Parameters:
        id - the bot id
        Returns:
        the previous bot