コード例 #1
0
        static void Main(string[] args)
        {
            var config = new HostConfiguration()
            {
                UrlReservations = new UrlReservations()
                {
                    CreateAutomatically = true
                }
            };

            using (var host = new NancyHost(config, new Uri("http://localhost:9012")))
            {
                host.Start();

                var oAuthToken   = GetTokensAndShit.GetOAuthToken();
                var authedClient = SlackClientStuff.GetSlackClient(oAuthToken);

                authedClient?.PostMessage(
                    result => Console.WriteLine("Response was: " + JsonConvert.SerializeObject(result, Formatting.Indented)),
                    Constants.CHANNEL_NAME,
                    "Test!");

                Console.WriteLine("Please press [Enter] to exit the application.");
                Console.ReadLine();
            }
        }
コード例 #2
0
 public static SlackClient IWantAClient()
 {
     return(GetSlackClient(GetTokensAndShit.GetOAuthToken(false)));
 }