Skip to content

Commit

Permalink
Add CurrentUser::default_avatar_url
Browse files Browse the repository at this point in the history
Add `default_avatar_url` to `CurrentUser` to match `User`'s avatar
functions.
  • Loading branch information
Zeyla Hellyer committed Jun 4, 2017
1 parent 063a52f commit 2d09152
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/model/user.rs
Expand Up @@ -72,6 +72,13 @@ impl CurrentUser {
})
}

/// Returns the formatted URL to the user's default avatar URL.
///
/// This will produce a PNG URL.
pub fn default_avatar_url(&self) -> String {
cdn!("/embed/avatars/{}.png", self.discriminator % 5u16).to_owned()
}

/// Alias of [`tag`].
///
/// [`tag`]: #method.tag
Expand Down

0 comments on commit 2d09152

Please sign in to comment.