Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions SlackAPI/RPCMessages/ConversationsMembersResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace SlackAPI.RPCMessages
{
[RequestPath("conversations.members")]
public class ConversationsMembersResponse : Response
{
public string[] members;
}
}
14 changes: 14 additions & 0 deletions SlackAPI/SlackClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@ public void GetConversationsList(Action<ConversationsListResponse> callback, str

APIRequestWithToken(callback, parameters.ToArray());
}

public void GetConversationsMembers(Action<ConversationsMembersResponse> callback, string channelId, string cursor = "", int limit = 100)
{
List<Tuple<string, string>> parameters = new List<Tuple<string, string>>
{
new Tuple<string, string>("channel", channelId)
};
if (limit > 0)
parameters.Add(Tuple.Create("limit", limit.ToString()));
if (!string.IsNullOrEmpty(cursor))
parameters.Add(Tuple.Create("cursor", cursor));

APIRequestWithToken(callback, parameters.ToArray());
}

public void GetChannelList(Action<ChannelListResponse> callback, bool ExcludeArchived = true)
{
Expand Down
14 changes: 14 additions & 0 deletions SlackAPI/SlackTaskClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,20 @@ public Task<ConversationsListResponse> GetConversationsListAsync(string cursor =

return APIRequestWithTokenAsync<ConversationsListResponse>(parameters.ToArray());
}

public Task<ConversationsMembersResponse> GetConversationsMembersAsync(string channelId, string cursor = "", int limit = 100)
{
List<Tuple<string, string>> parameters = new List<Tuple<string, string>>
{
new Tuple<string, string>("channel", channelId)
};
if (limit > 0)
parameters.Add(Tuple.Create("limit", limit.ToString()));
if (!string.IsNullOrEmpty(cursor))
parameters.Add(new Tuple<string, string>("cursor", cursor));

return APIRequestWithTokenAsync<ConversationsMembersResponse>(parameters.ToArray());
}

public Task<ChannelListResponse> GetChannelListAsync(bool ExcludeArchived = true)
{
Expand Down