Package discord4j.rest
Class RestResources
- java.lang.Object
-
- discord4j.rest.RestResources
-
public class RestResources extends Object
A set of resources required for key Discord4J features like entity manipulation and API communication.
-
-
Constructor Summary
Constructors Constructor Description RestResources(String token, ReactorResources reactorResources, JacksonResources jacksonResources, Router router, AllowedMentions allowedMentions)
Create aRestResources
instance with the given resources.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<AllowedMentions>
getAllowedMentions()
Return the configuredAllowedMentions
, if present.JacksonResources
getJacksonResources()
Return Jackson resources to transform objects.ReactorResources
getReactorResources()
Return Reactor resources to establish connections and schedule tasks.Router
getRouter()
Return theRouter
tied to this resources object.Snowflake
getSelfId()
Gets the bot user's ID.String
getToken()
Return the bot token used to authenticate requests.
-
-
-
Constructor Detail
-
RestResources
public RestResources(String token, ReactorResources reactorResources, JacksonResources jacksonResources, Router router, @Nullable AllowedMentions allowedMentions)
Create aRestResources
instance with the given resources.- Parameters:
token
- the bot token used to authenticate requestsreactorResources
- Reactor resources to establish connections and schedule tasksjacksonResources
- Jackson data-binding resources to map objectsrouter
- a connector to perform requests against Discord APIallowedMentions
- 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 theRouter
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 configuredAllowedMentions
, if present.- Returns:
- the configured allowed mentions setting or empty Optional if none was configured
-
-