Skip to content

Commit

Permalink
Add User::distinct
Browse files Browse the repository at this point in the history
The distinct method concatenates the user's name and discriminator by
the hash (`#`) symbol.
  • Loading branch information
Illia K authored and Austin Hellyer committed Dec 3, 2016
1 parent 16d1b3c commit 31becb1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/model/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ impl CurrentUser {
}
}

/// Returns the DiscordTag(tm) of a User.
pub fn distinct(&self) -> String {
format!("{}#{}", self.name, self.discriminator)
}

/// Gets a list of guilds that the current user is in.
pub fn guilds(&self) -> Result<Vec<GuildInfo>> {
rest::get_guilds(GuildPagination::After(GuildId(0)), 100)
Expand Down

0 comments on commit 31becb1

Please sign in to comment.