public TelegramOutgoingService( ILogger <TelegramOutgoingService> logger, IOptions <TelegramOptions> options, IConnectionsRepository connections ) : base(logger, options, connections) { _logger = logger; _options = options.Value; _client = new TelegramBotClient(_options.Token); }
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; }