From 2d0d3c96fc772f351fda659f05bc91431df2b74c Mon Sep 17 00:00:00 2001 From: Driftay Date: Sun, 29 Sep 2019 06:50:45 -0400 Subject: [PATCH] Little thing to avoid npe's being thrown in the console --- .../java/com/massivecraft/factions/discord/CmdInviteBot.java | 1 - .../com/massivecraft/factions/discord/FactionChatHandler.java | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/massivecraft/factions/discord/CmdInviteBot.java b/src/main/java/com/massivecraft/factions/discord/CmdInviteBot.java index 252a9452..bf991a62 100644 --- a/src/main/java/com/massivecraft/factions/discord/CmdInviteBot.java +++ b/src/main/java/com/massivecraft/factions/discord/CmdInviteBot.java @@ -7,7 +7,6 @@ import com.massivecraft.factions.zcore.util.TL; import mkremins.fanciful.FancyMessage; import net.dv8tion.jda.core.JDA; import net.dv8tion.jda.core.Permission; -import org.bukkit.ChatColor; public class CmdInviteBot extends FCommand { diff --git a/src/main/java/com/massivecraft/factions/discord/FactionChatHandler.java b/src/main/java/com/massivecraft/factions/discord/FactionChatHandler.java index d799a0aa..791e3d43 100644 --- a/src/main/java/com/massivecraft/factions/discord/FactionChatHandler.java +++ b/src/main/java/com/massivecraft/factions/discord/FactionChatHandler.java @@ -38,6 +38,9 @@ public class FactionChatHandler extends ListenerAdapter { private void startBot() { try { jda = new JDABuilder(AccountType.BOT).setToken(Conf.discordBotToken).buildBlocking(); + if(jda == null) { + System.out.println("\n\n\n SABER-FACTIONS-DISCORD-INTEGRATION - Please Make a Valid Token To Use Discord Features! Location Conf.json discordBotToken.\n\n\n"); + } } catch (LoginException | InterruptedException e) { e.printStackTrace(); }