corrects betterAtHome for non discord-V users
This commit is contained in:
parent
2a1567bafb
commit
d9fd10fe23
2 changed files with 9 additions and 6 deletions
|
|
@ -5,6 +5,7 @@ using BetterSecondBotShared.Static;
|
||||||
using BetterSecondBot.bottypes;
|
using BetterSecondBot.bottypes;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using static BetterSecondBot.Program;
|
using static BetterSecondBot.Program;
|
||||||
|
using BetterSecondbot.BetterAtHome;
|
||||||
|
|
||||||
namespace BetterSecondBot
|
namespace BetterSecondBot
|
||||||
{
|
{
|
||||||
|
|
@ -13,15 +14,16 @@ namespace BetterSecondBot
|
||||||
public bool Exited { get { return exitBot; } }
|
public bool Exited { get { return exitBot; } }
|
||||||
protected bool exitBot = false;
|
protected bool exitBot = false;
|
||||||
public SecondBot Bot;
|
public SecondBot Bot;
|
||||||
|
protected BetterAtHome betterAtHomeService;
|
||||||
|
|
||||||
protected void keep_alive()
|
protected void keep_alive()
|
||||||
{
|
{
|
||||||
while (Bot.KillMe == false)
|
while (Bot.KillMe == false)
|
||||||
{
|
{
|
||||||
string NewStatusMessage = Bot.GetStatus();
|
string NewStatusMessage = Bot.GetStatus();
|
||||||
|
NewStatusMessage = NewStatusMessage.Trim();
|
||||||
if (NewStatusMessage != Bot.LastStatusMessage)
|
if (NewStatusMessage != Bot.LastStatusMessage)
|
||||||
{
|
{
|
||||||
NewStatusMessage = NewStatusMessage.Trim();
|
|
||||||
if (NewStatusMessage.Replace(" ", "") != "")
|
if (NewStatusMessage.Replace(" ", "") != "")
|
||||||
{
|
{
|
||||||
Bot.LastStatusMessage = NewStatusMessage;
|
Bot.LastStatusMessage = NewStatusMessage;
|
||||||
|
|
@ -30,6 +32,7 @@ namespace BetterSecondBot
|
||||||
}
|
}
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
}
|
}
|
||||||
|
betterAtHomeService = null;
|
||||||
}
|
}
|
||||||
public CliExitOnLogout(JsonConfig Config, bool as_docker, bool use_self_keep_alive)
|
public CliExitOnLogout(JsonConfig Config, bool as_docker, bool use_self_keep_alive)
|
||||||
{
|
{
|
||||||
|
|
@ -39,6 +42,7 @@ namespace BetterSecondBot
|
||||||
{
|
{
|
||||||
Bot = new SecondBot();
|
Bot = new SecondBot();
|
||||||
Bot.Setup(Config, AssemblyInfo.GetGitHash());
|
Bot.Setup(Config, AssemblyInfo.GetGitHash());
|
||||||
|
betterAtHomeService = new BetterAtHome(this, Config);
|
||||||
if (as_docker == true)
|
if (as_docker == true)
|
||||||
{
|
{
|
||||||
Bot.AsDocker();
|
Bot.AsDocker();
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace BetterSecondBot.DiscordSupervisor
|
||||||
{
|
{
|
||||||
protected int warmup = 0;
|
protected int warmup = 0;
|
||||||
protected BetterRelay relayService;
|
protected BetterRelay relayService;
|
||||||
protected BetterAtHome betterAtHomeService;
|
|
||||||
protected override void keep_alive()
|
protected override void keep_alive()
|
||||||
{
|
{
|
||||||
while (exit_super == false)
|
while (exit_super == false)
|
||||||
|
|
@ -85,7 +85,6 @@ namespace BetterSecondBot.DiscordSupervisor
|
||||||
controler = new CliExitOnLogout(myconfig, running_as_docker, self_keep_alive);
|
controler = new CliExitOnLogout(myconfig, running_as_docker, self_keep_alive);
|
||||||
controler.Bot.setDiscordClient(DiscordClient);
|
controler.Bot.setDiscordClient(DiscordClient);
|
||||||
relayService = new BetterRelay(controler, this, running_as_docker);
|
relayService = new BetterRelay(controler, this, running_as_docker);
|
||||||
betterAtHomeService = new BetterAtHome(controler, myconfig);
|
|
||||||
attach_events();
|
attach_events();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue