diff --git a/src/main/java/me/chayapak1/chomens_bot/Main.java b/src/main/java/me/chayapak1/chomens_bot/Main.java index 34c6729..da24da4 100644 --- a/src/main/java/me/chayapak1/chomens_bot/Main.java +++ b/src/main/java/me/chayapak1/chomens_bot/Main.java @@ -215,15 +215,17 @@ public class Main { final boolean discordEnabled = config.discord.enabled; for (Bot bot : copiedList) { - if (discordEnabled) { - final String channelId = bot.discord.servers.get(bot.host + ":" + bot.port); + try { + if (discordEnabled) { + final String channelId = bot.discord.servers.get(bot.host + ":" + bot.port); - bot.discord.sendMessageInstantly("Stopping..", channelId); - } + bot.discord.sendMessageInstantly("Stopping..", channelId); + } - if (ircEnabled) bot.irc.quit("Stopping.."); + if (ircEnabled) bot.irc.quit("Stopping.."); - bot.stop(); + bot.stop(); + } catch (Exception ignored) {} } if (jda != null) jda.shutdown();