From cc72e99a240fc8846540a71dc0b4ef0a241a51f0 Mon Sep 17 00:00:00 2001 From: Oleg Shevchenko Date: Fri, 11 May 2018 19:35:41 +0300 Subject: [PATCH] Fix post message with new workspace token --- SlackAPI/SlackClient.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SlackAPI/SlackClient.cs b/SlackAPI/SlackClient.cs index c38eba1..0b128d1 100644 --- a/SlackAPI/SlackClient.cs +++ b/SlackAPI/SlackClient.cs @@ -598,7 +598,7 @@ public void PostMessage( bool unfurl_links = false, string icon_url = null, string icon_emoji = null, - bool as_user = false, + bool? as_user = null, string thread_ts = null) { List> parameters = new List>(); @@ -632,7 +632,8 @@ public void PostMessage( if (!string.IsNullOrEmpty(icon_emoji)) parameters.Add(new Tuple("icon_emoji", icon_emoji)); - parameters.Add(new Tuple("as_user", as_user.ToString())); + if (as_user.HasValue) + parameters.Add(new Tuple("as_user", as_user.ToString())); if (!string.IsNullOrEmpty(thread_ts)) parameters.Add(new Tuple("thread_ts", thread_ts));