Somme code refractor
This commit is contained in:
parent
40a4efe714
commit
c3ff5a9ad1
@ -34,7 +34,7 @@ public class Init {
|
||||
* @param dev dev Mode or not
|
||||
* @return JDA object
|
||||
*/
|
||||
static JDA initJda(String token, boolean dev){
|
||||
static JDA initJda(String token){
|
||||
JDA jda = null;
|
||||
logger.debug("-------------------INITIALISATION-------------------");
|
||||
|
||||
|
@ -53,25 +53,12 @@ public class MainBot {
|
||||
logger.info("--------------Starting Bot-------------");
|
||||
logger.info("=======================================");
|
||||
|
||||
if(System.getenv("DEV")!= null){
|
||||
dev = Boolean.parseBoolean(System.getenv("DEV"));
|
||||
}
|
||||
String token = System.getenv("TOKEN");
|
||||
|
||||
String token = null;
|
||||
int i = 0;
|
||||
for(String aArg: args){
|
||||
logger.debug(aArg);
|
||||
if(aArg.startsWith("--") || aArg.startsWith("-")){
|
||||
aArg = aArg.replaceAll("-","");
|
||||
if(aArg.equals("dev") || aArg.equals("d")){
|
||||
dev = true;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
token = System.getenv("TOKEN");
|
||||
jda = Init.initJda(token, dev);
|
||||
if(System.getenv("dev")!= null){
|
||||
dev = true;
|
||||
}
|
||||
|
||||
jda = Init.initJda(token);
|
||||
|
||||
|
||||
ConfigurableApplicationContext ctx = SpringApplication.run(MainBot.class, args);
|
||||
@ -85,14 +72,6 @@ public class MainBot {
|
||||
Init.polish(jda);
|
||||
ready = true;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -40,7 +40,7 @@ public class LimitChecker {
|
||||
}
|
||||
number-=400;
|
||||
redirected = false;
|
||||
logger.trace("First pass: "+number);
|
||||
logger.debug("First pass: "+number);
|
||||
while(!redirected )
|
||||
{
|
||||
String origin = baseURL+number+"-2/";
|
||||
@ -53,7 +53,7 @@ public class LimitChecker {
|
||||
}
|
||||
number-=90;
|
||||
redirected = false;
|
||||
logger.trace("Second pass: "+number);
|
||||
logger.debug("Second pass: "+number);
|
||||
while(!redirected )
|
||||
{
|
||||
String origin = baseURL+number+"-2/";
|
||||
@ -66,7 +66,7 @@ public class LimitChecker {
|
||||
}
|
||||
number-=9;
|
||||
redirected = false;
|
||||
logger.trace("Third pass: "+number);
|
||||
logger.debug("Third pass: "+number);
|
||||
while(!redirected )
|
||||
{
|
||||
String origin = baseURL+number+"-2/";
|
||||
@ -78,7 +78,7 @@ public class LimitChecker {
|
||||
redirected = true;
|
||||
}
|
||||
number-=1;
|
||||
logger.trace("Final pass: "+number);
|
||||
logger.debug("Final pass: "+number);
|
||||
return number;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user