fix: FINALLY fix discord ctrl+c stopping message not showing
This commit is contained in:
@@ -217,14 +217,14 @@ public class Main {
|
||||
}
|
||||
|
||||
if (discordEnabled) {
|
||||
discord.jda.shutdown();
|
||||
|
||||
for (int i = 0; i < 150; i++) {
|
||||
try {
|
||||
if (!ArrayUtilities.isAllTrue(stoppedDiscord)) Thread.sleep(50);
|
||||
else break;
|
||||
} catch (InterruptedException ignored) {}
|
||||
}
|
||||
|
||||
discord.jda.shutdown();
|
||||
}
|
||||
|
||||
if (callSystemExit) System.exit(exitCode);
|
||||
|
||||
@@ -68,6 +68,7 @@ public class DiscordPlugin {
|
||||
|
||||
final JDABuilder builder = JDABuilder.createDefault(config.discord.token);
|
||||
builder.enableIntents(GatewayIntent.MESSAGE_CONTENT);
|
||||
builder.setEnableShutdownHook(false);
|
||||
try {
|
||||
jda = builder.build();
|
||||
jda.awaitReady();
|
||||
|
||||
Reference in New Issue
Block a user