Skip to content

Commit df12ef3

Browse files
author
yitzy299
committedMay 23, 2021
Fix #3
Before this commit, once FAPI's server stopped event triggered, the JDA would instantly shut down. However, moving to FAPI server stopping event would cause an exception. This is fixed by using Jda#shutdown as opposed to Jda#shutdownNow Signed-off-by: yitzy299 <yitzy299@noreply.github.com>
1 parent 6618880 commit df12ef3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/main/java/com/github/quiltservertools/blockbot/BlockBot.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void onInitializeServer() {
2525
server.stop(false);
2626
}
2727
});
28-
ServerLifecycleEvents.SERVER_STOPPED.register(server -> {
28+
ServerLifecycleEvents.SERVER_STOPPING.register(server -> {
2929
CONFIG.shutdown();
3030
DISCORD.serverStatus(false);
3131
DISCORD.shutdown();

‎src/main/java/com/github/quiltservertools/blockbot/Discord.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public Discord(Config config, MinecraftServer server) throws LoginException {
5151
}
5252

5353
public void shutdown() {
54-
jda.shutdownNow();
54+
jda.shutdown();
5555
webhook.close();
5656
}
5757

0 commit comments

Comments
 (0)
Please sign in to comment.