public static async Task <IReadOnlyCollection <RestUser> > GetUsersAsync(BaseTwitchClient client, string[] usernames, RequestOptions options = null) { var model = await client.ApiClient.GetUsersAsync(usernames, options).ConfigureAwait(false); if (model.Users != null) { return(model.Users.Select(x => RestUser.Create(client, x)).ToArray()); } return(null); }
public static async Task <RestUser> GetUserAsync(BaseTwitchClient client, ulong userId, RequestOptions options = null) { var model = await client.ApiClient.GetUserAsync(userId, options).ConfigureAwait(false); if (model != null) { return(RestUser.Create(client, model)); } return(null); }
public static async Task <IReadOnlyCollection <RestUser> > GetEditorsAsync(BaseTwitchClient client, ulong channelId, RequestOptions options = null) { var model = await client.ApiClient.GetChannelEditorsAsync(channelId, options).ConfigureAwait(false); return(model.Users.Select(x => RestUser.Create(client, x)).ToArray()); }