From 4e7b4016f3a47d4175d85f9e2b0c8cb855acdf8d Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Sat, 21 Aug 2021 22:32:50 +0100 Subject: [PATCH] fixs a crash if you try and start the bot without discord --- BetterSecondbot/DiscordSupervisor/Discord-super.cs | 6 ++++-- Core/bottypes/VirtualsBot.cs | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/BetterSecondbot/DiscordSupervisor/Discord-super.cs b/BetterSecondbot/DiscordSupervisor/Discord-super.cs index efce66d..54bd9e2 100644 --- a/BetterSecondbot/DiscordSupervisor/Discord-super.cs +++ b/BetterSecondbot/DiscordSupervisor/Discord-super.cs @@ -85,10 +85,12 @@ namespace BetterSecondBot.DiscordSupervisor controler = null; } controler = new Cli(myconfig, running_as_docker, self_keep_alive, use_folder); - controler.getBot().setDiscordClient(DiscordClient); + if (myconfig.DiscordFull_Enable == true) + { + controler.getBot().setDiscordClient(DiscordClient); + } relayService = new BetterRelay(controler, this, running_as_docker); attach_events(); } - } } diff --git a/Core/bottypes/VirtualsBot.cs b/Core/bottypes/VirtualsBot.cs index 5020dfa..b0b6ee5 100644 --- a/Core/bottypes/VirtualsBot.cs +++ b/Core/bottypes/VirtualsBot.cs @@ -57,6 +57,10 @@ namespace BetterSecondBot.bottypes } public bool discordReady() { + if (myconfig.DiscordFull_Enable == false) + { + return false; + } if (DiscordLink == null) { DiscordReadyWhyFailed = "No client";