Class GetBotAction

    • Constructor Detail

      • GetBotAction

        public GetBotAction​(@Nonnull
                            String id)
        Constructor to get an instance of GetBotAction.

        Using this constructor will set the following default values ({id} will be replaced with the provided ID):

        • Cache: Enabled
        • User-Agent: "JavaBotBlockAPI-0000/API_VERSION (Unknown; +https://jbba.dev) DBots/{id}"

        Following Exceptions can be thrown from the CheckUtil:

        Parameters:
        id - The id of the bot. This is required for the internal User-Agent.
      • GetBotAction

        public GetBotAction​(boolean disableCache,
                            @Nonnull
                            String id)
        Constructor to get an instance of GetBotAction.
        This constructor allows you to disable the internal caching, by providing true as the first argument.

        Using this constructor will set the following default values ({id} will be replaced with the provided ID):

        • User-Agent: "JavaBotBlockAPI-0000/API_VERSION (Unknown; +https://jbba.dev) DBots/{id}"

        Following Exceptions can be thrown from the CheckUtil:

        Parameters:
        disableCache - If the cache should be disabled.
        true means the cache is disabled.
        id - The id of the bot. This is required for the internal User-Agent.
      • GetBotAction

        public GetBotAction​(boolean disableCache,
                            @Nonnull
                            String userAgent,
                            @Nonnull
                            String id)
        Constructor to get the instance of GetBotAction.
        This constructor allows you to disable the internal caching, by providing true as the first argument and also set a own User-Agent for the requests by providing any String as the second argument.

        Note that you can provide {id} inside the userAgent to get it replaced with the provided id.

        Following Exceptions can be thrown from the CheckUtil:

        Parameters:
        disableCache - If the cache should be disabled.
        true means the cache is disabled.
        userAgent - The Name that should be used as User-Agent.
        id - The id of the bot. This is required for the internal User-Agent.
    • Method Detail

      • getBotListInfo

        @Nullable
        public JSONObject getBotListInfo​(long id)
        Gets the information from the various bot lists.
        The returned data is entirely dependant on the bot list itself and is therefore unique.

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The bots id to use.
        Returns:
        Possibly-null JSONObject containing information from the different bot list.
      • getBotListInfo

        @Nullable
        public JSONObject getBotListInfo​(@Nonnull
                                         String id)
        Gets the information from the various bot lists.
        The returned data is entirely dependant on the bot list itself and is therefore unique.

        Following Exceptions can be thrown from the HTTP request:

        A RatelimitedException may be thrown from the RequestHandler, if the HTTP request was rate limited.

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the bot list info from.
        Returns:
        Possibly-null JSONObject containing information from the different bot list.
      • getBotListInfo

        @Nullable
        public JSONArray getBotListInfo​(@Nonnull
                                        Long id,
                                        @Nonnull
                                        Site site)
        Gets the information from the specified bot list.
        The returned data is entirely dependant on the bot list itself and is therefore unique.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the bot list info from.
        site - The site to get info from.
        Returns:
        Possibly-null JSONArray containing the information of the provided bot list.
      • getBotListInfo

        @Nullable
        public JSONArray getBotListInfo​(@Nonnull
                                        Long id,
                                        @Nonnull
                                        String site)
        Gets the information from the specified bot list.
        The returned data is entirely dependant on the bot list itself and is therefore unique.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the bot list info from.
        site - The site to get info from.
        Returns:
        Possibly-null JSONArray containing the information of the provided bot list.
      • getBotListInfo

        @Nullable
        public JSONArray getBotListInfo​(@Nonnull
                                        String id,
                                        @Nonnull
                                        Site site)
        Gets the information from the specified bot list.
        The returned data is entirely dependant on the bot list itself and is therefore unique.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the bot list info from.
        site - The site to get info from.
        Returns:
        Possibly-null JSONArray containing the information of the provided bot list.
      • getBotListInfo

        @Nullable
        public JSONArray getBotListInfo​(@Nonnull
                                        String id,
                                        @Nonnull
                                        String site)
        Gets the information from the specified bot list.
        The returned data is entirely dependant on the bot list itself and is therefore unique.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the bot list info from.
        site - The site to get info from.
        Returns:
        Possibly-null JSONArray containing the information of the provided bot list.
      • getDiscriminator

        @Nullable
        public String getDiscriminator​(@Nonnull
                                       Long id)
        Gets the discriminator (The 4 numbers after the # in the username) of the bot.
        The discriminator is based on the most common appearance of it across the bot lists.

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the discriminator from.
        Returns:
        Possibly-null String containing the discriminator of the bot or 0000 if the provided id is invalid.
        Since:
        4.2.0
      • getDiscriminator

        @Nullable
        public String getDiscriminator​(@Nonnull
                                       String id)
        Gets the discriminator (The 4 numbers after the # in the username) of the bot.
        The discriminator is based on the most common appearance of it.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the discriminator from.
        Returns:
        Possibly-null String containing the discriminator of the bot or 0000 if the provided id is invalid.
        Since:
        4.2.0
      • getGitHub

        @Nullable
        public String getGitHub​(@Nonnull
                                Long id)
        Gets the GitHub link of the bot.
        The GitHub link is based on the most common appearance of it.

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the GitHub link from.
        Returns:
        Possibly-null or possibly-empty String containing the GitHub link of the bot.
        Since:
        4.2.0
      • getGitHub

        @Nullable
        public String getGitHub​(@Nonnull
                                String id)
        Gets the GitHub link of the bot.
        The GitHub link is based on the most common appearance of it.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the GitHub link from.
        Returns:
        Possibly-null or possibly-empty String containing the GitHub link of the bot.
        Since:
        4.2.0
      • getLibrary

        @Nullable
        public String getLibrary​(@Nonnull
                                 Long id)
        Gets the currently used library of the bot.
        The library is based on the most common appearance of it.

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the library from.
        Returns:
        Possibly-null or possibly-empty String containing the library of the bot.
        Since:
        4.2.0
      • getLibrary

        @Nullable
        public String getLibrary​(@Nonnull
                                 String id)
        Gets the currently used library of the bot.
        The library is based on the most common appearance of it.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the library from.
        Returns:
        Possibly-null or possibly-empty String containing the library of the bot.
        Since:
        4.2.0
      • getName

        @Nullable
        public String getName​(@Nonnull
                              Long id)
        Gets the name of the bot.
        The name is based on the most common appearance of it.

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the name from.
        Returns:
        Possibly-null String containing the name of the bot or Unknown if the provided id is invalid.
        Since:
        4.2.0
      • getName

        @Nullable
        public String getName​(@Nonnull
                              String id)
        Gets the name of the bot.
        The name is based on the most common appearance of it.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the name from.
        Returns:
        Possibly-null String containing the name of the bot or Unknown if the provided id is invalid.
        Since:
        4.2.0
      • getOAuthInvite

        @Nullable
        public String getOAuthInvite​(@Nonnull
                                     Long id)
        Gets the OAuth invite link of a bot.
        The OAuth invite is used to add a bot to a Discord server.

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the OAuth link from.
        Returns:
        Possibly-null or possibly-empty String containing the OAuth link for the bot.
        Since:
        5.1.13
      • getOAuthInvite

        @Nullable
        public String getOAuthInvite​(@Nonnull
                                     String id)
        Gets the OAuth invite link of a bot.
        The OAuth invite is used to add a bot to a Discord server.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the OAuth link from.
        Returns:
        Possibly-null or possibly-empty String containing the OAuth link for the bot.
        Since:
        5.1.13
      • getOwners

        @Nullable
        public List<String> getOwners​(@Nonnull
                                      Long id)
        Gets an ArrayList with the owner ids of the bot.
        The IDs listed are based on how often they appear on the different bot lists.

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the Owners from.
        Returns:
        Possibly-empty ArrayList containing the owners of the bot.
      • getOwners

        @Nullable
        public List<String> getOwners​(@Nonnull
                                      String id)
        Gets an ArrayList with the owner ids of the bot.
        The IDs listed are based on how often they appear on the different bot lists.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the Owners from.
        Returns:
        Possibly-empty ArrayList containing the owners of the bot.
      • getPrefix

        @Nullable
        public String getPrefix​(@Nonnull
                                Long id)
        Gets the prefix of the bot.
        The prefix is based on the most common appearance of it.

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the prefix from.
        Returns:
        Possibly-null or possibly-empty String containing the prefix of the bot.
        Since:
        4.2.0
      • getPrefix

        @Nullable
        public String getPrefix​(@Nonnull
                                String id)
        Gets the prefix of the bot.
        The prefix is based on the most common appearance of it.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the prefix from.
        Returns:
        Possibly-null or possibly-empty String containing the prefix of the bot.
        Since:
        v4.2.0
      • getServerCount

        @Nullable
        public Integer getServerCount​(@Nonnull
                                      Long id)
        Gets the server count of the bot.
        The server count is based on the most common appearance of it.

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the server count from.
        Returns:
        Possibly-null Integer containing the server count for the bot.
      • getServerCount

        @Nullable
        public Integer getServerCount​(@Nonnull
                                      String id)
        Gets the server count of the bot.
        The server count is based on the most common appearance of it.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the server count from.
        Returns:
        Possibly-null Integer containing the server count for the bot.
      • getSupportLink

        @Nullable
        public String getSupportLink​(@Nonnull
                                     Long id)
        Gets the support link (i.e. Discord invite) from the bot.
        The link is based on the most common appearance of it.

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the support link from.
        Returns:
        Possibly-null or possibly-empty String containing the support link.
      • getSupportLink

        @Nullable
        public String getSupportLink​(@Nonnull
                                     String id)
        Gets the support link (i.e. Discord invite) from the bot.
        The link is based on the most common appearance of it.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the support link from.
        Returns:
        Possibly-null or possibly-empty String containing the support link.
      • getWebsite

        @Nullable
        public String getWebsite​(@Nonnull
                                 Long id)
        Gets the website of the bot.
        The website is based on the most common appearance of it.

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the website from.
        Returns:
        Possibly-null or possibly-empty String containing the bot's website.
        Since:
        v4.2.0
      • getWebsite

        @Nullable
        public String getWebsite​(@Nonnull
                                 String id)
        Gets the website of the bot.
        The website is based on the most common appearance of it.

        Following Exceptions can be thrown from the CheckUtil:

        Following Exceptions can be thrown from the HTTP request:

        This method may also return null if the request wasn't successful.

        Parameters:
        id - The id of the bot to get the website from.
        Returns:
        Possibly-null or possibly-empty String containing the bot's website.
        Since:
        v4.2.0