public async Task <bool> SendPairProfit(string currency) { if (!PairProfitState.WaitingForCurrency) { return(false); } try { var ccy = currency.Trim().ToUpper(); _log.LogInformation($"User wants to check for profit for {ccy}"); await _bus.SendAsync(new PairProfitCommand(ccy)); } catch (Exception) { await _bus.SendAsync(new SendMessageCommand($"Something went wrong. Probably because you entered in a dud currency or I have no trade details")); } return(PairProfitState.Reset()); }
public async Task <bool> SendPairProfit(string currency) { if (!PairProfitState.WaitingForCurrency) { return(false); } try { var ccy = currency.Trim().ToUpper(); _log.LogInformation($"User wants to check for profit for {ccy}"); await _bus.SendAsync(new PairProfitCommand(ccy)); } catch (Exception) { var mess = new StringBuffer(); mess.Append(StringContants.PairProfitError); await _bus.SendAsync(new SendMessageCommand(mess)); } return(PairProfitState.Reset()); }