diff --git a/SlackAPI/SlackClient.cs b/SlackAPI/SlackClient.cs index 8245096..546ae67 100644 --- a/SlackAPI/SlackClient.cs +++ b/SlackAPI/SlackClient.cs @@ -597,8 +597,8 @@ public void PostMessage( bool unfurl_links = false, string icon_url = null, string icon_emoji = null, - bool as_user = false, - string thread_ts = null) + bool? as_user = null, + string thread_ts = null) { List> parameters = new List>(); @@ -631,7 +631,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));