Add MasterBot configuration properties to TradingBotBase and ensure MasterBotUserId preservation in RestartBotCommandHandler
- Introduced IsForCopyTrading, MasterBotIdentifier, and MasterBotUserId properties in TradingBotBase for enhanced bot configuration. - Updated RestartBotCommandHandler to preserve MasterBotUserId from the database bot configuration.
This commit is contained in:
@@ -2650,6 +2650,9 @@ public class TradingBotBase : ITradingBot
|
|||||||
UseForSignalFiltering = Config.UseForSignalFiltering,
|
UseForSignalFiltering = Config.UseForSignalFiltering,
|
||||||
UseForDynamicStopLoss = Config.UseForDynamicStopLoss,
|
UseForDynamicStopLoss = Config.UseForDynamicStopLoss,
|
||||||
RiskManagement = Config.RiskManagement,
|
RiskManagement = Config.RiskManagement,
|
||||||
|
IsForCopyTrading = Config.IsForCopyTrading,
|
||||||
|
MasterBotIdentifier = Config.MasterBotIdentifier,
|
||||||
|
MasterBotUserId = Config.MasterBotUserId,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,12 @@ namespace Managing.Application.ManageBot
|
|||||||
throw new InvalidOperationException($"Could not retrieve configuration for bot {request.Identifier}");
|
throw new InvalidOperationException($"Could not retrieve configuration for bot {request.Identifier}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure MasterBotUserId is preserved from the database bot
|
||||||
|
if (bot.MasterBotUserId.HasValue && botConfig.MasterBotUserId != bot.MasterBotUserId.Value)
|
||||||
|
{
|
||||||
|
botConfig.MasterBotUserId = bot.MasterBotUserId.Value;
|
||||||
|
}
|
||||||
|
|
||||||
// Get account to check GMX initialization status
|
// Get account to check GMX initialization status
|
||||||
Account account;
|
Account account;
|
||||||
if (string.IsNullOrEmpty(botConfig.AccountName))
|
if (string.IsNullOrEmpty(botConfig.AccountName))
|
||||||
|
|||||||
Reference in New Issue
Block a user