Fix usage of CacheMode.AllowDownload in channels (#2154)
Co-Authored-By: ✨ <25006819+sabihoshi@users.noreply.github.com> Co-authored-by: ✨ <25006819+sabihoshi@users.noreply.github.com>
This commit is contained in:
@@ -533,8 +533,15 @@ namespace Discord.WebSocket
|
||||
=> await CreateGuildAsync(name, region, jpegIcon).ConfigureAwait(false);
|
||||
|
||||
/// <inheritdoc />
|
||||
Task<IUser> IDiscordClient.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
|
||||
=> Task.FromResult<IUser>(GetUser(id));
|
||||
async Task<IUser> IDiscordClient.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
|
||||
{
|
||||
var user = GetUser(id);
|
||||
if (user is not null || mode == CacheMode.CacheOnly)
|
||||
return user;
|
||||
|
||||
return await Rest.GetUserAsync(id, options).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
Task<IUser> IDiscordClient.GetUserAsync(string username, string discriminator, RequestOptions options)
|
||||
=> Task.FromResult<IUser>(GetUser(username, discriminator));
|
||||
|
||||
Reference in New Issue
Block a user