diff --git a/src/Discord.Net/DiscordSocketClient.cs b/src/Discord.Net/DiscordSocketClient.cs index 4abc901d7..82289fe95 100644 --- a/src/Discord.Net/DiscordSocketClient.cs +++ b/src/Discord.Net/DiscordSocketClient.cs @@ -362,11 +362,11 @@ namespace Discord return DataStore.RemoveUser(id); } - /// Downloads the members list for all large guilds. - public Task DownloadAllMembersAsync() - => DownloadMembersAsync(DataStore.Guilds.Where(x => !x.HasAllMembers)); - /// Downloads the members list for the provided guilds, if they don't have a complete list. - public async Task DownloadMembersAsync(IEnumerable guilds) + /// Downloads the users list for all large guilds. + public Task DownloadAllUsersAsync() + => DownloadUsersAsync(DataStore.Guilds.Where(x => !x.HasAllMembers)); + /// Downloads the users list for the provided guilds, if they don't have a complete list. + public async Task DownloadUsersAsync(IEnumerable guilds) { const short batchSize = 50; var cachedGuilds = guilds.Select(x => x as CachedGuild).ToArray(); @@ -374,7 +374,7 @@ namespace Discord return; else if (cachedGuilds.Length == 1) { - await cachedGuilds[0].DownloadMembersAsync().ConfigureAwait(false); + await cachedGuilds[0].DownloadUsersAsync().ConfigureAwait(false); return; } diff --git a/src/Discord.Net/Entities/Guilds/Guild.cs b/src/Discord.Net/Entities/Guilds/Guild.cs index 31a0f5916..0031fad85 100644 --- a/src/Discord.Net/Entities/Guilds/Guild.cs +++ b/src/Discord.Net/Entities/Guilds/Guild.cs @@ -289,6 +289,10 @@ namespace Discord model = await Discord.ApiClient.BeginGuildPruneAsync(Id, args).ConfigureAwait(false); return model.Pruned; } + public virtual Task DownloadUsersAsync() + { + throw new NotSupportedException(); + } internal GuildChannel ToChannel(API.Channel model) { @@ -311,7 +315,6 @@ namespace Discord IRole IGuild.EveryoneRole => EveryoneRole; IReadOnlyCollection IGuild.Emojis => Emojis; IReadOnlyCollection IGuild.Features => Features; - Task IGuild.DownloadUsersAsync() { throw new NotSupportedException(); } IAudioClient IGuild.AudioClient => null; IRole IGuild.GetRole(ulong id) => GetRole(id); diff --git a/src/Discord.Net/Entities/WebSocket/CachedGuild.cs b/src/Discord.Net/Entities/WebSocket/CachedGuild.cs index 22b2df52b..e1641be03 100644 --- a/src/Discord.Net/Entities/WebSocket/CachedGuild.cs +++ b/src/Discord.Net/Entities/WebSocket/CachedGuild.cs @@ -206,7 +206,7 @@ namespace Discord return member; return null; } - public async Task DownloadMembersAsync() + public override async Task DownloadUsersAsync() { if (!HasAllMembers) await Discord.ApiClient.SendRequestMembersAsync(new ulong[] { Id }).ConfigureAwait(false);