Exemplo n.º 1
0
        public TelegramOutgoingService(
            ILogger <TelegramOutgoingService> logger,
            IOptions <TelegramOptions> options,
            IConnectionsRepository connections
            )
            : base(logger, options, connections)
        {
            _logger  = logger;
            _options = options.Value;

            _client = new TelegramBotClient(_options.Token);
        }
Exemplo n.º 2
0
        public TelegramService(
            ILogger <TelegramService> logger,
            IOptions <TelegramOptions> options,
            IBehaviorExecutor behaviorExecutor,
            IPlatformDatabase database,
            ServiceContext serviceContext
            )
            : base(logger, options, behaviorExecutor, database, serviceContext)
        {
            _logger  = logger;
            _options = options.Value;
            _botId   = serviceContext.BotId;

            _client                 = new TelegramBotClient(_options.Token);
            _client.OnMessage      += OnMessageAsync;
            _client.OnReceiveError += OnReceiveError;
        }