From 31becb16f184cd7d396b383ad4abed8095451fcb Mon Sep 17 00:00:00 2001 From: Illia K Date: Sat, 3 Dec 2016 15:55:31 +0000 Subject: Add User::distinct The distinct method concatenates the user's name and discriminator by the hash (`#`) symbol. --- src/model/user.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/model/user.rs b/src/model/user.rs index 0cb0c3a..969b051 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -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> { rest::get_guilds(GuildPagination::After(GuildId(0)), 100) -- cgit v1.2.3