Esempio n. 1
0
 public void PostMessage(SlackMessage2 message)
 {
     using (WebClient client = new WebClient())
     {
         NameValueCollection data = new NameValueCollection();
         data["payload"] = JsonConvert.SerializeObject(message);
         var    response     = client.UploadValues(_uri, "POST", data);
         string responseText = _encoding.GetString(response);
     }
 }
Esempio n. 2
0
        public void PostMessage(string text, string userName = null, string channel = null, string iconEmoji = null)
        {
            SlackMessage2 message = new SlackMessage2()
            {
                Channel  = channel,
                UserName = userName,
                Text     = text
            };

            PostMessage(message);
        }