コード例 #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));
        }
コード例 #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();
                }
            }
        }
コード例 #3
0
ファイル: Dialog.cs プロジェクト: Hangzhou-Yunstorm/MoMoBot
        public Dialog(string dialogId)
        {
            MoMoBotAssert.ValueNullOrWhiteSpace(dialogId);

            Id = dialogId;
        }