public MessagesController() { IUsersRepository usersRepository = new UsersRepository(_connectionString); _chatsRepository = new ChatsRepository(_connectionString, usersRepository); _messagesRepository = new MessagesRepository(_connectionString, usersRepository, _chatsRepository); }
public UsersRepository(string connectionString, IAuthRepository authRepository = null, IChatsRepository chatReposirory = null) { _connectionString = connectionString; _authRepository = authRepository ?? new AuthRepository(_connectionString, this); _chatReposirory = chatReposirory ?? new ChatsRepository(_connectionString, this); }
public AccountSessionHandler(SessionData sessionData, ILogger <AccountSessionHandler> logger, IChatsRepository chatsRepository, SubscriptionFactory subscriptionFactory) { _sessionData = sessionData; _logger = logger; _chatsRepository = chatsRepository; _subscription = subscriptionFactory.Create(); _sessionSubject = new BehaviorSubject <SessionData>(sessionData); _subscription.Add(_sessionSubject); SessionChanges = _sessionSubject; _cancelSubject = new Subject <Unit>(); _subscription.Add(_cancelSubject); _supportedMessages = new Dictionary <string, Func <IObservable <Unit> > >(StringComparer.OrdinalIgnoreCase) { { "/start", () => Observable.Empty <Unit>() }, { "/stop", () => Observable.Empty <Unit>() }, { "/help", () => ShowHelp() }, { "/login", () => Login() }, { "/username", () => RequestUsername() }, { "/session", () => RequestSession() }, { "/token", () => RequestAuthToken() }, { "/cancel", () => Cancel() }, { "/pause", () => StartPauseDialog() }, { "/resume", () => Resume() }, { "/mute", () => StartMuteDialog() }, { "/unmute", () => Unmute() }, { "/timezone", () => RequestTimezone() }, }; }
public AccountsHandler(ILogger <AccountsHandler> accountsHandlerLogger, ILogger <AccountSessionHandler> accountsLogger, SubscriptionFactory subscriptionFactory, IAccountsService accountsService, IChatsRepository chatsRepository) { this._accountsHandlerLogger = accountsHandlerLogger; _accountsLogger = accountsLogger; _subscriptionFactory = subscriptionFactory; _accountsService = accountsService; _chatsRepository = chatsRepository; }
public MessagesRepository(string connectionString, IUsersRepository usersRepository = null, IAttachsRepository attachsRepository = null, IChatsRepository chatsRepository = null) { _connectionString = connectionString; _usersRepository = usersRepository ?? new UsersRepository(_connectionString); _attachsRepository = attachsRepository ?? new AttachsRepository(_connectionString, _usersRepository); _chatsRepository = chatsRepository ?? new ChatsRepository(_connectionString, _usersRepository, _attachsRepository, this); }
public DefaultController( IWordsRepository <Word, WordsCountBotDbContext> wordsRepo, IChatsRepository <Chat, WordsCountBotDbContext> chatsRepo, IUsagesRepository <WordUsedTimes, WordsCountBotDbContext> usagesRepo ) { _wordsRepo = wordsRepo; _chatsRepo = chatsRepo; _usagesRepo = usagesRepo; }
public TelegramAccountsHandler(SubscriptionFactory subscriptionFactory, IChatsRepository chatsRepository, BotClientFactory botClientFactory, MessageFactory messageFactory, MessageSender messageSender) { _subscriptions = subscriptionFactory.Create(); _sessionChanges = new Subject <SessionData>(); _subscriptions.Add(_sessionChanges); _chatsRepository = chatsRepository; _botClientFactory = botClientFactory; _messageFactory = messageFactory; this._messageSender = messageSender; }
public WcbTelegramBot( ILogger <WcbTelegramBot> logger, IWordsRepository <Word, WordsCountBotDbContext> wordsRepo, IChatsRepository <MyChat, WordsCountBotDbContext> chatsRepo, IUsagesRepository <WordUsedTimes, WordsCountBotDbContext> usagesRepo, IWcbTelegramClient client ) { _logger = logger; _wordsRepo = wordsRepo; _chatsRepo = chatsRepo; _usagesRepo = usagesRepo; _client = client; }
public TableTennisBot( TelegramBotConfiguration configuration, RealTimeRetriever realTimeRetriever, IChatsRepository chatsRepository, IAccessTokenRepository accessTokenRepository) { _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); _realTimeRetriever = realTimeRetriever ?? throw new ArgumentNullException(nameof(realTimeRetriever)); _chatsRepository = chatsRepository ?? throw new ArgumentNullException(nameof(chatsRepository)); _accessTokenRepository = accessTokenRepository ?? throw new ArgumentNullException(nameof(accessTokenRepository)); _botClient = new TelegramBotClient(_configuration.AccessToken); _botClient.OnMessage += MessageHandler; _realTimeRetriever.OnGoodBigScorePercentageFound += GoodBigScorePercentageHandler; _botClient.StartReceiving(); }
public ChatsController(IChatsRepository chatsRepository) { _chatsRepository = chatsRepository; }
public ChatController() { _profilesRepository = new ProfilesRepository(Constants.Constants.ConnectionString); _chatsRepository = new ChatsRepository(Constants.Constants.ConnectionString, _profilesRepository); }
public MessagesRepository(string connectionString, IUsersRepository usersRepository, IChatsRepository chatsRepository) { _connectionString = connectionString; _usersRepository = usersRepository; _chatsRepository = chatsRepository; }
public ChatsBusinessWorkflow(IChatsRepository chatsRepository, IChatMapper chatMapper) { ChatsRepository = chatsRepository; ChatMapper = chatMapper; }
/// <summary> /// Инициализация строки подключения для работы с таблицей "Профили". /// </summary> /// <param name="connectionString">Строка подключения.</param> public ProfilesRepository(string connectionString) { _connectionString = connectionString; _chatsRepository = new ChatsRepository(connectionString, this); }
public SessionsController(IChatsRepository chatsRepository) { _chatsRepository = chatsRepository; }