Fix restart/start if not account with the first account of the user
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user