Example #1
0
 public async Task <string> Menu(ChatSession session)
 {
     session.State        = State.Idle;
     session.ExpectedWord = 0;
     session.WordSequence = null;
     return((await _translation.GetText("idle_message")).Russian);
 }
Example #2
0
        public async Task <IResponseInfo> AfterAction(IAfterActionRequestInfo info)
        {
            if (info.Request.Session.WordSequence == null || info.Request.Session.ExpectedWord >= info.Request.Session.WordSequence.Count)
            {
                await GenerateSequenceAsync(info);
            }

            var next = await _repository.GetNextTask(info.Request.Session.WordSequence[info.Request.Session.ExpectedWord]);

            var text = await _translations.GetText("text_afterAction");

            if (text == null)
            {
                return(new AfterActionResponseInfo(ResponseCodes.LogicInternalError, "No Translation for text_afterAction"));
            }

            var message = string.Format(text.Russian, next);

            return(new AfterActionResponseInfo(next != null ? ResponseCodes.OK : ResponseCodes.LogicInternalError, message));
        }