Exemplo n.º 1
0
 public StopCommand(UserCacheService userCache, UserRepository userRepository, PackagesRepository packagesRepository, ChatSessionService session)
 {
     _userCache          = userCache;
     _userRepository     = userRepository;
     _packagesRepository = packagesRepository;
     _session            = session;
 }
Exemplo n.º 2
0
 public StartCommand(
     IOptions <TelegramSettings> settings, UserRepository userRepository,
     UserCacheService userCache, FlypackService flypackService, ChatSessionService session,
     PasswordEncrypterService encrypter, PackageNotificationParser parser)
 {
     _parser         = parser;
     _settings       = settings.Value;
     _userCache      = userCache;
     _userRepository = userRepository;
     _flypack        = flypackService;
     _session        = session;
     _encrypter      = encrypter;
 }
        public TelegramUpdateHandler(FlypackService flypack, ChatSessionService session, UserLanguageUpdater updater, TelegramSettings settings, StartCommand startCommand, StopCommand stopCommand, PackagesCommand packagesCommand, UpdatePasswordCommand updatePasswordCommand, PackageNotificationParser parser, Func <Exception, CancellationToken, Task> errorHandler, ILogger logger)
        {
            _parser       = parser;
            _session      = session;
            _flypack      = flypack;
            _updater      = updater;
            _settings     = settings;
            _errorHandler = errorHandler;
            _logger       = logger;

            _stopCommand           = stopCommand;
            _startCommand          = startCommand;
            _packagesCommand       = packagesCommand;
            _updatePasswordCommand = updatePasswordCommand;
        }
Exemplo n.º 4
0
 public Worker(
     FlypackService flypack, ChatSessionService session, UserCacheService userCache, StartCommand startCommand,
     StopCommand stopCommand, PackagesCommand packagesCommand, UpdatePasswordCommand updatePasswordCommand,
     PackageNotificationParser parser, IOptions <TelegramSettings> settings, ILogger <Worker> logger)
 {
     _logger                = logger;
     _parser                = parser;
     _settings              = settings.Value;
     _flypack               = flypack;
     _session               = session;
     _userCache             = userCache;
     _startCommand          = startCommand;
     _stopCommand           = stopCommand;
     _packagesCommand       = packagesCommand;
     _updatePasswordCommand = updatePasswordCommand;
     _telegram              = new TelegramBotClient(_settings.AccessToken);
     _timer = new Timer(async(state) => { await StoreChanges(); });
 }