Update Status.cs

minor tweaks to status display
This commit is contained in:
Madpeterz 2021-03-25 04:58:04 +00:00
parent 3223191979
commit 2c6f37d358

View file

@ -17,6 +17,7 @@ namespace BetterSecondBot.DiscordSupervisor
} }
} }
public string lastStatus = "";
public string GetStatus() public string GetStatus()
{ {
string reply = ""; string reply = "";
@ -39,10 +40,26 @@ namespace BetterSecondBot.DiscordSupervisor
{ {
reply = " " + reply; reply = " " + reply;
} }
if(reply != lastStatus)
{
lastStatus = reply;
}
else
{
reply = "";
}
if(HasBasicBot() == true) if(HasBasicBot() == true)
{ {
controler.Bot.LastStatusMessage = controler.Bot.GetStatus(); string newreply = controler.Bot.GetStatus();
reply = controler.Bot.LastStatusMessage + reply; if(newreply != controler.Bot.LastStatusMessage)
{
controler.Bot.LastStatusMessage = newreply;
}
else
{
newreply = "";
}
reply = newreply + reply;
if (controler.Bot.KillMe == true) if (controler.Bot.KillMe == true)
{ {
if (controler.Bot.GetClient.Network.Connected == true) if (controler.Bot.GetClient.Network.Connected == true)