Fix restart/start if not account with the first account of the user

This commit is contained in:
2025-10-12 16:08:12 +07:00
parent 176573ddd1
commit ff74296c26
4 changed files with 61 additions and 7 deletions

View File

@@ -1006,4 +1006,17 @@ public class LiveTradingBotGrain : Grain, ILiveTradingBotGrain, IRemindable
return true;
}
}
/// <summary>
/// Gets the user who owns this bot
/// </summary>
public Task<User> GetUserAsync()
{
if (_state.State.User == null)
{
throw new InvalidOperationException($"Bot '{_state.State.Config?.Name}' (ID: {_state.State.Identifier}) has no user information.");
}
return Task.FromResult(_state.State.User);
}
}