mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-18 06:02:54 +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) {
|
if (current != null) {
|
||||||
current.close();
|
current.close();
|
||||||
}
|
}
|
||||||
channelIdToWebhook.remove(channel.getId());
|
channelIdToWebhook.remove(channel.getId()).close();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
typeToChannelId.put(type, channel.getId());
|
typeToChannelId.put(type, channel.getId());
|
||||||
@ -430,6 +430,10 @@ public class JDADiscordService implements DiscordService, IEssentialsModule {
|
|||||||
|
|
||||||
shutdownConsoleRelay(true);
|
shutdownConsoleRelay(true);
|
||||||
|
|
||||||
|
for (WebhookClient webhook : channelIdToWebhook.values()) {
|
||||||
|
webhook.close();
|
||||||
|
}
|
||||||
|
|
||||||
// Unregister leftover jda listeners
|
// Unregister leftover jda listeners
|
||||||
for (Object obj : jda.getRegisteredListeners()) {
|
for (Object obj : jda.getRegisteredListeners()) {
|
||||||
if (!(obj instanceof EventListener)) { // Yeah bro I wish I knew too :/
|
if (!(obj instanceof EventListener)) { // Yeah bro I wish I knew too :/
|
||||||
|
Loading…
Reference in New Issue
Block a user