Fix stop/restart
This commit is contained in:
@@ -116,14 +116,15 @@ public class TradingBot : Bot, ITradingBot
|
||||
// Send startup message only for fresh starts (not reboots)
|
||||
// Consider it a reboot if the bot was created more than 5 minutes ago
|
||||
var timeSinceCreation = DateTime.UtcNow - CreateDate;
|
||||
var isReboot = timeSinceCreation.TotalMinutes > 5;
|
||||
var isReboot = timeSinceCreation.TotalMinutes > 3;
|
||||
|
||||
StartupTime = DateTime.UtcNow;
|
||||
|
||||
if (!isReboot)
|
||||
{
|
||||
try
|
||||
{
|
||||
StartupTime = DateTime.UtcNow;
|
||||
|
||||
var indicatorNames = Indicators.Select(i => i.Type.ToString()).ToList();
|
||||
var startupMessage = $"🚀 **Bot Started Successfully!**\n\n" +
|
||||
$"📊 **Trading Setup:**\n" +
|
||||
@@ -157,6 +158,7 @@ public class TradingBot : Bot, ITradingBot
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
InitWorker(Run).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
@@ -1458,6 +1460,7 @@ public class TradingBot : Bot, ITradingBot
|
||||
Identifier = backup.Identifier;
|
||||
User = backup.User;
|
||||
Status = backup.LastStatus;
|
||||
StartupTime = data.StartupTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user