Fallback to user repo when retrieving a user via the discord gateway fails or times out

This commit is contained in:
runebaas 2020-12-29 17:12:03 +01:00
parent 714b0008bc
commit 7e792bd782
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
2 changed files with 16 additions and 3 deletions

View file

@ -14,6 +14,7 @@ namespace Geekbot.Core.Polyfills
public UserStatus Status { get; set; }
public IImmutableSet<ClientType> ActiveClients { get; }
public string AvatarId { get; set; }
public string AvatarUrl { get; set; }
public string Discriminator { get; set; }
public ushort DiscriminatorValue { get; set; }
public bool IsBot { get; set; }
@ -22,7 +23,7 @@ namespace Geekbot.Core.Polyfills
public string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128)
{
return "https://discordapp.com/assets/6debd47ed13483642cf09e832ed0bc1b.png";
return AvatarUrl ?? "https://discordapp.com/assets/6debd47ed13483642cf09e832ed0bc1b.png";
}
public string GetDefaultAvatarUrl()