コード例 #1
0
        public async Task ExecuteAsync(Update update)
        {
            var user = await _registrationService.RegisterIfNotExists(update);

            await _messageSender.SendTo(user.Id,
                                        string.Format(Resources.HelloFormat, user.FirstName, user.LastName));
        }
コード例 #2
0
        public async Task ExecuteAsync(Update update)
        {
            await _registrationService.RegisterIfNotExists(update);

            var messageText = update.Message.Text;
            var userId      = update.Message.From.Id;

            _logger.LogDebug($"User {userId} sends {messageText}");
        }
コード例 #3
0
        public async Task ExecuteAsync(Update update)
        {
            var user = await _userRegistrationService.RegisterIfNotExists(update);

            user.UserStatus = UserStatus.Answered;
            await _useRepository.UpdateAsync(user);

            var category = await _categoryRepository.GetUserCategory(user.Id);

            await _messageSender.SendTo(user.Id, string.Format(Resources.AllCorrectResponse,
                                                               category.Name, category.Description));
        }
コード例 #4
0
        public async Task ExecuteAsync(Update update)
        {
            var user = await _registrationService.RegisterIfNotExists(update);

            _logger.LogDebug($"User {update.Message.From.Id} tries to start game");

            user.UserStatus = UserStatus.Player;
            await _usersRepository.UpdateAsync(user);

            await _messageSender.SendTo(user.Id, Resources.GameStarted);

            await _nextQuestionCommand.ExecuteAsync(update);
        }