put back onto another thread
This commit is contained in:
parent
3e16f212da
commit
ab98d752c8
@ -153,20 +153,18 @@ public final class DiscordService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Initialize the bot
|
// Initialize the bot
|
||||||
|
new Thread(() -> {
|
||||||
long before = System.currentTimeMillis();
|
long before = System.currentTimeMillis();
|
||||||
log.info("Logging in..."); // Log that we're logging in
|
log.info("Logging in..."); // Log that we're logging in
|
||||||
System.out.println("Step 1");
|
jda = JDABuilder.createDefault(token)
|
||||||
JDA jda = JDABuilder.createDefault(token)
|
|
||||||
.enableIntents(
|
.enableIntents(
|
||||||
GatewayIntent.GUILD_MEMBERS
|
GatewayIntent.GUILD_MEMBERS
|
||||||
).setStatus(OnlineStatus.DO_NOT_DISTURB)
|
).setStatus(OnlineStatus.DO_NOT_DISTURB)
|
||||||
.setActivity(Activity.watching("your licenses"))
|
.setActivity(Activity.watching("your licenses"))
|
||||||
.addEventListeners(new EventHandler())
|
.addEventListeners(new EventHandler())
|
||||||
.build();
|
.build();
|
||||||
System.out.println("step 2");
|
|
||||||
try {
|
try {
|
||||||
jda.awaitReady(); // Await JDA to be ready
|
jda.awaitReady(); // Await JDA to be ready
|
||||||
System.out.println("await complete");
|
|
||||||
|
|
||||||
// Log that we're logged in
|
// Log that we're logged in
|
||||||
log.info("Logged into {} in {}ms",
|
log.info("Logged into {} in {}ms",
|
||||||
@ -182,7 +180,7 @@ public final class DiscordService {
|
|||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
System.out.println("finish");
|
}, "Discord Bot Thread").start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user