aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorIllia K <[email protected]>2016-12-03 15:55:31 +0000
committerAustin Hellyer <[email protected]>2016-12-03 08:16:17 -0800
commit31becb16f184cd7d396b383ad4abed8095451fcb (patch)
tree22412aceffaeb0f31deb497ccf787e5c003205b4 /src/model
parentAdd CurrentUser::edit (diff)
downloadserenity-31becb16f184cd7d396b383ad4abed8095451fcb.tar.xz
serenity-31becb16f184cd7d396b383ad4abed8095451fcb.zip
Add User::distinct
The distinct method concatenates the user's name and discriminator by the hash (`#`) symbol.
Diffstat (limited to 'src/model')
-rw-r--r--src/model/user.rs5
1 files changed, 5 insertions, 0 deletions
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<Vec<GuildInfo>> {
rest::get_guilds(GuildPagination::After(GuildId(0)), 100)