Exemplo n.º 1
0
 public CheckUserCommandHandler(ILogger logger, ITelegramClientService telegramFactory,
                                ITelegramUserRepository telegramRepository)
     : base(logger, telegramFactory, telegramRepository)
 {
     _telegramUserRepository = telegramRepository;
     _telegramFactory        = telegramFactory;
 }
Exemplo n.º 2
0
 public GetIllnessQueryHandler(ILogger logger, ITelegramClientService telegramClientService,
                               IIllnessRepository illnessRepository)
     : base(logger)
 {
     _telegramClientService = telegramClientService;
     _illnessRepository     = illnessRepository;
     _logger = logger;
 }
 public GetMezajTypeQueryHandler(ILogger logger, ITelegramClientService telegramClientService,
                                 INutritionRepository nutritionRepository, INutritionService nutritionService, ILogger logger1)
     : base(logger)
 {
     _telegramClientService = telegramClientService;
     _nutritionRepository   = nutritionRepository;
     _nutritionService      = nutritionService;
     _logger = logger1;
 }
Exemplo n.º 4
0
 public GetWebhookCommand(Options opts, ITelegramClientService tgClientService)
 {
     _opts = opts;
     if (String.IsNullOrWhiteSpace(_opts.Token))
     {
         throw new ArgumentNullException("No bot token provided!");
     }
     _client = tgClientService.GetClient(_opts);
 }
Exemplo n.º 5
0
 public TelegramListener(ILifetimeScope scope, ITelegramClientService telegramFactory)
 {
     _scope           = scope;
     _telegramFactory = telegramFactory;
     _cache           = _telegramFactory.GetCache();
     _bot             = _telegramFactory.GetTelegramBot();
     _allowUser       = new List <string> {
         "Ars4m", "eliakbari"
     };
 }
Exemplo n.º 6
0
        public Mode(Options opts, ITelegramClientService telegramClientService)
        {
            if (String.IsNullOrWhiteSpace(opts.FirstValue))
            {
                throw new ArgumentException("No command name given!");
            }
            var commandCode = opts.FirstValue;
            var cmdType     = _commandsAvailable.FirstOrDefault(type => type.Name == commandCode + "Command");

            if (cmdType == null)
            {
                throw new ArgumentException("Bad command code given!");
            }
            object[] ctorArgs = new object[] {
                opts,
                telegramClientService
            };
            Command = (ICommand)Activator.CreateInstance(cmdType, ctorArgs);
        }
Exemplo n.º 7
0
 protected CommandBase(ILogger logger, ITelegramClientService telegramFactory, ITelegramUserRepository telegramUserRepo)
 {
     _logger           = logger;
     _telegramFactory  = telegramFactory;
     _telegramUserRepo = telegramUserRepo;
 }
 public MezajTypeDtcCommandHandler(ILogger logger, ITelegramClientService telegramFactory, ITelegramUserRepository telegramRepository)
     : base(logger, telegramFactory, telegramRepository)
 {
     _telegramFactory = telegramFactory;
 }