diff --git a/EssentialsDiscord/src/main/java/net/essentialsx/discord/JDADiscordService.java b/EssentialsDiscord/src/main/java/net/essentialsx/discord/JDADiscordService.java index 129b64985..a1030442c 100644 --- a/EssentialsDiscord/src/main/java/net/essentialsx/discord/JDADiscordService.java +++ b/EssentialsDiscord/src/main/java/net/essentialsx/discord/JDADiscordService.java @@ -333,7 +333,7 @@ public class JDADiscordService implements DiscordService, IEssentialsModule { if (current != null) { current.close(); } - channelIdToWebhook.remove(channel.getId()); + channelIdToWebhook.remove(channel.getId()).close(); continue; } typeToChannelId.put(type, channel.getId()); @@ -430,6 +430,10 @@ public class JDADiscordService implements DiscordService, IEssentialsModule { shutdownConsoleRelay(true); + for (WebhookClient webhook : channelIdToWebhook.values()) { + webhook.close(); + } + // Unregister leftover jda listeners for (Object obj : jda.getRegisteredListeners()) { if (!(obj instanceof EventListener)) { // Yeah bro I wish I knew too :/