Exemplo n.º 1
0
        private async Task <DialogDto> StartFlowAnswer(QandA answer, string conversationId)
        {
            MoMoBotAssert.ValueNullOrWhiteSpace(answer.FlowId);

            var start = await _mapContext.StartAsync(answer.FlowId, conversationId);

            return(new DialogDto(conversationId, answer.Id, answer.Intent, start?.Question, AnswerTypes.ProcessFlow));
        }
Exemplo n.º 2
0
        public async Task SetAsync(string key, string value)
        {
            MoMoBotAssert.KeyNotNullOrEmpty(key);
            MoMoBotAssert.ValueNullOrWhiteSpace(value);

            var setting = await _dbContext.Settings.FirstOrDefaultAsync(s => s.Key == key);

            if (setting != null)
            {
                if (setting.ReadOnly == false)
                {
                    setting.Value = value;
                    _dbContext.Settings.Update(setting);
                    await _dbContext.SaveChangesAsync();
                    await GetSettingsFromDBAsync();
                }
            }
        }
Exemplo n.º 3
0
        public Dialog(string dialogId)
        {
            MoMoBotAssert.ValueNullOrWhiteSpace(dialogId);

            Id = dialogId;
        }