Class RestResources


  • public class RestResources
    extends Object
    A set of resources required for key Discord4J features like entity manipulation and API communication.
    • Constructor Detail

      • RestResources

        public RestResources​(String token,
                             ReactorResources reactorResources,
                             JacksonResources jacksonResources,
                             Router router,
                             @Nullable
                             AllowedMentions allowedMentions)
        Create a RestResources instance with the given resources.
        Parameters:
        token - the bot token used to authenticate requests
        reactorResources - Reactor resources to establish connections and schedule tasks
        jacksonResources - Jackson data-binding resources to map objects
        router - a connector to perform requests against Discord API
        allowedMentions - a configuration object to limit mentions creating notifications on message sending
    • Method Detail

      • getToken

        public String getToken()
        Return the bot token used to authenticate requests.
        Returns:
        the bot token
      • getReactorResources

        public ReactorResources getReactorResources()
        Return Reactor resources to establish connections and schedule tasks.
        Returns:
        a configured ReactorResources instance
      • getJacksonResources

        public JacksonResources getJacksonResources()
        Return Jackson resources to transform objects.
        Returns:
        a configured JacksonResources instance
      • getRouter

        public Router getRouter()
        Return the Router tied to this resources object.
        Returns:
        a configured Router instance
      • getSelfId

        public Snowflake getSelfId()
        Gets the bot user's ID.
        Returns:
        The bot user's ID.
      • getAllowedMentions

        public Optional<AllowedMentions> getAllowedMentions()
        Return the configured AllowedMentions, if present.
        Returns:
        the configured allowed mentions setting or empty Optional if none was configured