Skip to content

Commit adf25a0

Browse files
committed
updated GetUserListAsync with optional arguments
1 parent f0084d1 commit adf25a0

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

SlackAPI/SlackTaskClient.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,20 @@ public Task<AuthTestResponse> TestAuthAsync()
9999
return APIRequestWithTokenAsync<AuthTestResponse>();
100100
}
101101

102-
public Task<UserListResponse> GetUserListAsync()
102+
public Task<UserListResponse> GetUserListAsync(int limit = 0, bool include_locale = false, string cursor = null, string team_id = null)
103103
{
104-
return APIRequestWithTokenAsync<UserListResponse>();
104+
var args = new List<Tuple<string, string>>();
105+
args.Add(new Tuple<string, string>("limit", limit.ToString()));
106+
args.Add(new Tuple<string, string>("include_locale", include_locale.ToString()));
107+
if (cursor != null)
108+
{
109+
args.Add(new Tuple<string, string>("cursor", cursor));
110+
}
111+
if (team_id != null)
112+
{
113+
args.Add(new Tuple<string, string>("team_id", team_id));
114+
}
115+
return APIRequestWithTokenAsync<UserListResponse>(args.ToArray());
105116
}
106117

107118
public Task<UserEmailLookupResponse> GetUserByEmailAsync(string email)

0 commit comments

Comments
 (0)