Class BotBlockAPI.Builder

    • Constructor Detail

      • Builder

        public Builder()
        Empty constructor to get the class.
    • Method Detail

      • addAuthToken

        public BotBlockAPI.Builder addAuthToken​(@Nonnull
                                                Site site,
                                                @Nonnull
                                                String token)
        Adds the provided Site name and token to the Map.
        Entries with the same key will be overwritten.
        Parameters:
        site - The Site to get the name from.
        token - The API token from the corresponding bot list. May not be null or empty.
        You may receive the API token from the bot list.

        Following Exceptions can be thrown from the CheckUtil:

        Returns:
        The Builder after the site and token were set. Useful for chaining.
        Since:
        2.1.0
      • addAuthToken

        public BotBlockAPI.Builder addAuthToken​(@Nonnull
                                                String site,
                                                @Nonnull
                                                String token)
        Adds the provided Site name and token to the Map.
        Entries with the same key will be overwritten.
        Parameters:
        site - The name of the site. May not be null or empty.
        A list of supported sites can be found here.
        token - The API token from the corresponding bot list. May not be null or empty.
        You may receive the API token from the bot list.

        Following Exceptions can be thrown from the CheckUtil:

        Returns:
        The Builder after the site and token were set. Useful for chaining.
      • setAuthTokens

        public BotBlockAPI.Builder setAuthTokens​(@Nonnull
                                                 Map<String,​String> tokens)
        Sets the provided Map as the new Map.
        This will overwrite every previously set entry!
        Parameters:
        tokens - The Map that should be used. May not be null.

        Following Exceptions can be thrown from the CheckUtil:

        Returns:
        The Builder after the Map was set. Useful for chaining.
      • setUpdateDelay

        public BotBlockAPI.Builder setUpdateDelay​(@Nonnull
                                                  Integer updateDelay)
        Sets the update delay (in minutes) for the auto-posting.
        You don't need to set this when not using the auto-post option. Default is 30.
        Parameters:
        updateDelay - The update interval in minutes that should be used. This can't be less than 2.

        Following Exceptions can be thrown from the CheckUtil:

        Returns:
        The Builder after the updateInterval was set. Useful for chaining.