mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-02 22:47:41 +01:00
Close discord webhook clients on shutdown (#5165)
This commit is contained in:
parent
6e931b2b3b
commit
4414eea513
@ -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 :/
|
||||
|
Loading…
Reference in New Issue
Block a user