diff --git a/SlackAPI/Conversation.cs b/SlackAPI/Conversation.cs index def8d1a..4f7d46e 100644 --- a/SlackAPI/Conversation.cs +++ b/SlackAPI/Conversation.cs @@ -8,6 +8,14 @@ namespace SlackAPI { public class Conversation { + public enum Type + { + public_channel, + private_channel, + mpim, + im + } + public string id; public DateTime created; public DateTime last_read; @@ -16,4 +24,4 @@ public class Conversation public int unread_count; public Message latest; } -} +} \ No newline at end of file diff --git a/SlackAPI/SlackClient.cs b/SlackAPI/SlackClient.cs index eae7033..ae97c31 100644 --- a/SlackAPI/SlackClient.cs +++ b/SlackAPI/SlackClient.cs @@ -147,7 +147,7 @@ public void ChannelsInvite(Action callback, string userId APIRequestWithToken(callback, parameters.ToArray()); } - public void GetConversationsList(Action callback, string cursor = "", bool ExcludeArchived = true, int limit = 100, string[] types = null) + public void GetConversationsList(Action callback, string cursor = "", bool ExcludeArchived = true, int limit = 100, Conversation.Type[] types = null) { List> parameters = new List>() { @@ -155,7 +155,7 @@ public void GetConversationsList(Action callback, str }; if (limit > 0) parameters.Add(Tuple.Create("limit", limit.ToString())); - if (types.Any()) + if (types != null && types.Any()) parameters.Add(Tuple.Create("types", string.Join(",", types))); if (!string.IsNullOrEmpty(cursor)) parameters.Add(Tuple.Create("cursor", cursor)); diff --git a/SlackAPI/SlackTaskClient.cs b/SlackAPI/SlackTaskClient.cs index c6815d2..f66abcf 100644 --- a/SlackAPI/SlackTaskClient.cs +++ b/SlackAPI/SlackTaskClient.cs @@ -127,7 +127,7 @@ public Task ChannelsInviteAsync(string userId, string cha return APIRequestWithTokenAsync(parameters.ToArray()); } - public Task GetConversationsListAsync(string cursor = "", bool ExcludeArchived = true, int limit = 100, string[] types = null) + public Task GetConversationsListAsync(string cursor = "", bool ExcludeArchived = true, int limit = 100, Conversation.Type[] types = null) { List> parameters = new List>() {