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:AgentApi
Obtain a connection specific to general users- Specified by:
getUserConnection
in interfaceAgentApi
- Returns:
- Connection
- Throws:
NullPointerException
-
getDevConnection
Description copied from interface:AgentApi
Obtain a connection specific to developers.- Specified by:
getDevConnection
in interfaceAgentApi
- Returns:
- Connection
-
getConnection
Description copied from interface:AgentApi
Obtain a general connection to the API, should not be used.- Specified by:
getConnection
in interfaceAgentApi
- Returns:
- general connection
-
isDevAccount
public boolean isDevAccount()- Specified by:
isDevAccount
in interfaceAgentApi
- Returns:
- true if the token used to validate the connection has dev permissions.
-
getGuildAnalytics
- Specified by:
getGuildAnalytics
in interfaceAgentApi
- Parameters:
api
- instance for GuildAnalyticsguildId
- guild to obtain analytics for- Returns:
- an instance of guild analytics for the given guild
-
getJdaUser
- Specified by:
getJdaUser
in interfaceAgentApi
- Parameters:
userId
- Takes the id from aUser
- Returns:
- an instance of JdaUser after being converted from an ID
-