Class JavalinManager
java.lang.Object
dev.jacrispys.JavaBot.api.libs.utils.JavalinManager
Web-based event listener to exchange Code's through Discord 0Auth
 
Link to API site: bot.insideagent.pro
Link to API site: bot.insideagent.pro
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidauthorizeUser(net.dv8tion.jda.api.utils.data.DataObject userData) Takes data from theexchangeCode(String)method to insert into the databaseprotected booleanexchangeCode(String code) Http Request builder to exchange the 0Auth code given by discord for credentialsprotected voidinitJavalin(int port) Initializes Javalin server to listen for queriesprotected StringCreates a token using a base 64 encoder that will be sent VIA dm's to the user
- 
Constructor Details- 
JavalinManagerpublic JavalinManager(int port) 
 
- 
- 
Method Details- 
initJavalinprotected void initJavalin(int port) Initializes Javalin server to listen for queries- Parameters:
- port- port to start the server on
 
- 
exchangeCodeHttp Request builder to exchange the 0Auth code given by discord for credentials- Parameters:
- code- code to exchange
- Returns:
- True if data was successfully obtained from Discord, false otherwise
 
- 
authorizeUserprotected void authorizeUser(net.dv8tion.jda.api.utils.data.DataObject userData) throws SQLException Takes data from theexchangeCode(String)method to insert into the database- Parameters:
- userData-- DataObject(json) compiled from the Http request
- Throws:
- SQLException- if a database error occurs
 
- 
tokenGeneratorCreates a token using a base 64 encoder that will be sent VIA dm's to the user- Returns:
- the token generated
 
 
-