internal static RestThreadUser Create(BaseDiscordClient client, IGuild guild, Model model, IThreadChannel channel) { var entity = new RestThreadUser(client, guild, channel, model.UserId.Value); entity.Update(model); return(entity); }
public static async Task <RestThreadUser> GetUserAsync(ulong userId, IThreadChannel channel, BaseDiscordClient client, RequestOptions options = null) { var model = await client.ApiClient.GetThreadMemberAsync(channel.Id, userId, options).ConfigureAwait(false); return(RestThreadUser.Create(client, channel.Guild, model, channel)); }
public static async Task <RestThreadUser[]> GetUsersAsync(IThreadChannel channel, BaseDiscordClient client, RequestOptions options = null) { var users = await client.ApiClient.ListThreadMembersAsync(channel.Id, options); return(users.Select(x => RestThreadUser.Create(client, channel.Guild, x, channel)).ToArray()); }