diff --git a/tegakituesday/src/models/user/mod.rs b/tegakituesday/src/models/user/mod.rs index a1a3794..2447fa5 100644 --- a/tegakituesday/src/models/user/mod.rs +++ b/tegakituesday/src/models/user/mod.rs @@ -92,11 +92,16 @@ impl User { } ), // Archived user or user with no avatar, calculate default avatar - // https://www.reddit.com/r/discordapp/comments/au6v4e/comment/eh61dm6/ - // https://docs.rs/serenity/0.11.5/serenity/model/user/struct.User.html#method.default_avatar_url None => format!( "https://cdn.discordapp.com/embed/avatars/{}.png", - self.discriminator % 5 + // https://docs.rs/serenity/0.12.4/src/serenity/model/user.rs.html#805 + if self.discriminator == 0 { + // New avatar system + ((self.id >> 22) % 6) as u16 + } else { + // Old avatar system + self.discriminator % 5 + } ), } }