protected override async Task ProcessCoreAsync(CreateTaskCommand command)
        {
            string userId = await _telegramService.GetUserId(command.UserChatId);

            command.Task.Uid = Guid.NewGuid().ToString();
            await _taskServiceApp.SaveTasksAsync(new[] { command.Task }, userId);

            await _botSendMessageService.SendTextAsync(command.UserChatId, "Task created");
        }
Exemple #2
0
        protected override async Task ProcessCoreAsync(ShowTodoCommand command)
        {
            string userId = await _telegramService.GetUserId(command.UserChatId);

            IEnumerable <TaskDto> tasks = await _taskServiceApp.LoadTasksByDateAsync(userId, command.From, command.To);

            ICollection <string> tasksAsString = await _taskServiceApp.PrintTasks(tasks);

            string text = tasksAsString.Count == 0
                ? "No tasks"
                : string.Join("\n", tasksAsString);
            await _botSendMessageService.SendTextAsync(command.UserChatId, text);
        }