Package dev.jacrispys.JavaBot.api.libs
Class AgentApiImpl
java.lang.Object
dev.jacrispys.JavaBot.api.libs.AgentApiImpl
- All Implemented Interfaces:
AgentApi
Implementation of all methods from
AgentApi-
Constructor Summary
ConstructorsConstructorDescriptionAgentApiImpl(DeveloperConnection connection, AgentOptions clientOptions) AgentApiImpl(UserConnection connection, AgentOptions clientOptions) -
Method Summary
Modifier and TypeMethodDescriptionObtain a general connection to the API, should not be used.Obtain a connection specific to developers.getGuildAnalytics(AgentApi api, long guildId) getJdaUser(long userId) Obtain a connection specific to general usersboolean
-
Constructor Details
-
AgentApiImpl
-
AgentApiImpl
-
-
Method Details
-
getUserConnection
Description copied from interface:AgentApiObtain a connection specific to general users- Specified by:
getUserConnectionin interfaceAgentApi- Returns:
- Connection
- Throws:
NullPointerException
-
getDevConnection
Description copied from interface:AgentApiObtain a connection specific to developers.- Specified by:
getDevConnectionin interfaceAgentApi- Returns:
- Connection
-
getConnection
Description copied from interface:AgentApiObtain a general connection to the API, should not be used.- Specified by:
getConnectionin interfaceAgentApi- Returns:
- general connection
-
isDevAccount
public boolean isDevAccount()- Specified by:
isDevAccountin interfaceAgentApi- Returns:
- true if the token used to validate the connection has dev permissions.
-
getGuildAnalytics
- Specified by:
getGuildAnalyticsin interfaceAgentApi- Parameters:
api- instance for GuildAnalyticsguildId- guild to obtain analytics for- Returns:
- an instance of guild analytics for the given guild
-
getJdaUser
- Specified by:
getJdaUserin interfaceAgentApi- Parameters:
userId- Takes the id from aUser- Returns:
- an instance of JdaUser after being converted from an ID
-