Skip to content

Commit

Permalink
Merge pull request #146 from Inumedia/pr/134
Browse files Browse the repository at this point in the history
Fixed merge conflict for PR #134 (as_user is an optional parameter)
  • Loading branch information
Inumedia authored Nov 5, 2018
2 parents 529fe21 + e9582e2 commit 43912b2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions SlackAPI/SlackClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Tuple<string,string>> parameters = new List<Tuple<string,string>>();

Expand Down Expand Up @@ -631,7 +631,8 @@ public void PostMessage(
if (!string.IsNullOrEmpty(icon_emoji))
parameters.Add(new Tuple<string, string>("icon_emoji", icon_emoji));

parameters.Add(new Tuple<string, string>("as_user", as_user.ToString()));
if (as_user.HasValue)
parameters.Add(new Tuple<string, string>("as_user", as_user.ToString()));

if (!string.IsNullOrEmpty(thread_ts))
parameters.Add(new Tuple<string, string>("thread_ts", thread_ts));
Expand Down

0 comments on commit 43912b2

Please sign in to comment.