Пример #1
0
 internal SlackWebApiClient(string token, ISlackConnector connector)
 {
     Chat           = new ChatSlackModule(token, connector);
     Groups         = new GroupsSlackModule(token, connector);
     Users          = new UsersSlackModule(token, connector);
     DirectMessages = new DirectMessagesModule(token, connector);
 }
Пример #2
0
        public SlackService(string key)
        {
            _key = key;

            _connector  = new SlackConnector.SlackConnector();
            _responders = ResponseBuilder.GetResponders();
        }
        public  SlackBotServer(string apiToken)
        {

            _apiToken = apiToken;
            _connector = new SlackConnector.SlackConnector();
            _chatBot = IocContainer.Instance.Resolve<IChatBot>();
            _isConnected = false;
        }
Пример #4
0
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            connector = new SlackConnector.SlackConnector();
            var accessToken = AmbientConnectionStringProvider.Instance.GetConnectionString(attribute.AccessToken);

            connection = await connector.Connect(accessToken);

            connection.OnMessageReceived += ConnectionOnOnMessageReceived;
            connection.OnDisconnect      += ConnectionOnOnDisconnect;
        }
Пример #5
0
        public async Task Connect()
        {
            var config = _configReader.GetConfig();

            _client = new SlackConnector.SlackConnector();
            _client.OnMessageReceived += MessageReceived;
            _client.OnConnectionStatusChanged += ConnectionStatusChanged;

            await _client.Connect(config.Slack.ApiToken);
        }
Пример #6
0
        /// <summary>
        ///     Constructor.
        /// </summary>
        /// <param name="connector">The Slack connector to use.</param>
        /// <param name="slackKey">The Slack key to use.</param>
        public SlackIntegration(ISlackConnector connector, string slackKey)
        {
            this.connector = connector ?? throw new ArgumentNullException(nameof(connector));

            if (string.IsNullOrEmpty(slackKey))
            {
                throw new ArgumentException(nameof(slackKey));
            }

            this.slackKey = slackKey;
        }
Пример #7
0
 public App(
     IRestClient client,
     IEnvironmentVariableReader envReader,
     ISlackConnector slack,
     ISecretHandler secretHandler,
     int timeout = 5000
     )
 {
     _client        = client;
     _envReader     = envReader;
     _slack         = slack;
     _secretHandler = secretHandler;
     _timeout       = timeout;
 }
Пример #8
0
 public SlackIntegrationTests(ITestOutputHelper output)
 {
     _output   = output;
     connector = new SlackConnector.SlackConnector();
 }
Пример #9
0
 internal SlackModule(string token, ISlackConnector connector)
 {
     _token     = token;
     _connector = connector;
 }
Пример #10
0
 public SlackIntegration(ISlackConnector connector, IAppConfig config)
 {
     this.connector = connector ?? throw new ArgumentNullException(nameof(connector));
     slackAPIToken  = config.SlackAPIToken;
 }
Пример #11
0
 public GroupsSlackModule(string token, ISlackConnector connector) : base(token, connector)
 {
 }
Пример #12
0
 public ChatSlackModule(string token, ISlackConnector connector) : base(token, connector)
 {
 }
Пример #13
0
 public SlackService(ISlackConnector connector, ISlackConfig config)
 {
     this.connector = connector;
     this.config    = config;
 }
Пример #14
0
 public Tester(string slackToken)
 {
     _firstStart = true;
     _slackToken = slackToken;
     _slackBot   = new SlackConnector.SlackConnector();
 }
Пример #15
0
 public DirectMessagesModule(string token, ISlackConnector connector) : base(token, connector)
 {
 }