Пример #1
0
        /// <summary>
        /// Check the client's basic authentication and identity information.
        /// </summary>
        private static async Task TestAuth(ISlackWebClient slackClient)
        {
            var authTestResponse = await slackClient.CallApiMethod <AuthTestReponse>(new AuthTestMethod());

            if (authTestResponse.Ok)
            {
                Console.WriteLine($"{ authTestResponse.User } has been authorized.");
            }
            else
            {
                Console.WriteLine($"Failed to authorize user - { authTestResponse.Error }");
            }
        }
Пример #2
0
        public SlackConnectionManager(ISlackConfigGroup slackConfigGroup,
                                      ISlackRtmClient slackRtmClient,
                                      ISlackWebClient slackWebClient,
                                      ISlackConnectionEventPublisher slackConnectionEventPublisher,
                                      IBashiLogger log)
        {
            botToken            = slackConfigGroup.BotToken;
            this.slackRtmClient = slackRtmClient;
            this.slackWebClient = slackWebClient;
            this.log            = log;

            slackConnectionEventPublisher.RtmDisconnected += (s, e) => Connect();
        }