Class SimpleBotManager

    • Constructor Detail

      • SimpleBotManager

        public SimpleBotManager()
    • Method Detail

      • login

        @NotNull
        public Future<Bot> login​(long id,
                                 String password,
                                 Plugin plugin)
        Description copied from interface: BotManager
        Login and get the bot with id and password
        Specified by:
        login in interface BotManager
        Parameters:
        id - the id of the bot
        password - the password of the bot
        plugin - the plugin
        Returns:
        the bot
      • loginDirectly

        @NotNull
        public Bot loginDirectly​(long id,
                                 String password,
                                 Plugin plugin)
                          throws BotLoginException
        Description copied from interface: BotManager
        Login and get the bot with id and password This is a blocking method
        Specified by:
        loginDirectly in interface BotManager
        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

        public boolean login​(Bot b)
                      throws BotLoginException
        Description copied from interface: BotManager
        Login the bot
        Specified by:
        login in interface BotManager
        Parameters:
        b - the bot need to log in
        Returns:
        true if the bot is not online, false otherwise
        Throws:
        BotLoginException - if the bot login failed
      • logout

        public boolean logout​(@NotNull
                              Bot bot)
        Description copied from interface: BotManager
        Logout the bot
        Specified by:
        logout in interface BotManager
        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: BotManager
        Get the bot with special id
        Specified by:
        getBot in interface BotManager
        Parameters:
        username - the id of the bot
        Returns:
        the bot with special id
      • relogin

        public boolean relogin​(@NotNull
                               Bot bot)
                        throws BotLoginException
        Description copied from interface: BotManager
        Relogin the bot
        Specified by:
        relogin in interface BotManager
        Parameters:
        bot - the bot need to relogin
        Returns:
        true if the bot is online, false otherwise
        Throws:
        BotLoginException - if the bot login failed
      • getBots

        public List<Bot> getBots()
        Description copied from interface: BotManager
        Get the list of bots
        Specified by:
        getBots in interface BotManager
        Returns:
        the list of bots
      • remove

        public Bot remove​(long id)
        Description copied from interface: BotManager
        Remove the bot
        Specified by:
        remove in interface BotManager
        Parameters:
        id - the bot id
        Returns:
        the previous bot
      • removeAll

        public static void removeAll()
      • remove

        public static void remove​(Plugin plugin)