コード例 #1
0
 public BotController(IOptions <Settings> settings, ITelegramService botService, IVkGroupsSearcher groupSearcher)
 {
     _settings        = settings;
     _botService      = botService;
     _vkGroupSearcher = groupSearcher;
     _logger          = LogManager.GetCurrentClassLogger();
 }
コード例 #2
0
        public TelegramMessageRouter(UsersContext db, IVkGroupsSearcher vk)
        {
            _db              = db;
            _logger          = LogManager.GetCurrentClassLogger();
            _messageHandlers = new Dictionary <ChatState, BaseTgMessageHandler>
            {
                // { ChatState.Standrard, new AddNewAlarms(_db) },
                { ChatState.NewGroupToAdd, new InputGroup(_db, vk) },
                { ChatState.NewWordToGroupAdd, new InputKeyword(_db) },
                { ChatState.EditExistingGroup, new UpdateKeywords(_db) },
                { ChatState.RemoveSettingsStep1, new RemoveSettingsStep2(_db) }
            };

            _commandHandlers = new Dictionary <string, BaseTgMessageHandler>
            {
                { TgBotText.AddNewSettings, new AddNewAlarms(_db) },
                { TgBotText.EditExistingSettings, new EditExistingSettings(_db, vk) },
                { TgBotText.RemoveSubscriptions, new RemoveSettingsStep1(_db, vk) }
            };
        }
コード例 #3
0
 public InputGroup(UsersContext db, IVkGroupsSearcher vk)
     : base(db)
 {
     _vk = vk;
 }
コード例 #4
0
 public RemoveSettingsStep1(UsersContext db, IVkGroupsSearcher vk)
     : base(db)
 {
     _vk = vk;
 }
コード例 #5
0
 public EditExistingSettings(UsersContext db, IVkGroupsSearcher vk)
     : base(db)
 {
     _vk = vk;
 }