Exemple #1
0
        public async Task <IReadOnlyCollection <ITelegramResponse> > Handle(SettingsCommand settingsCommand,
                                                                            CancellationToken cancellationToken)
        {
            var userState = await _userStateRepository.GetUserState(settingsCommand.UserId, cancellationToken);

            var replyKeyboard = GetSettingReplyKeyboardMarkupFor(userState);

            var response = new[] { new KeyboardTelegramResponse(replyKeyboard, "Choose") };

            return(response);
        }
Exemple #2
0
        public async Task <IReadOnlyCollection <ITelegramResponse> > Handle(EventsCommand command,
                                                                            CancellationToken cancellationToken)
        {
            var eventInfos = await GetEventInfos(command);

            var userState = await _stateRepository.GetUserState(command.UserId, cancellationToken);

            return(eventInfos.SelectMany(info => GetResponseForEvents(info, userState)).ToList());
        }