aboutsummaryrefslogtreecommitdiff
path: root/src/model/misc.rs
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-12-12 20:42:17 -0800
committerAustin Hellyer <[email protected]>2016-12-12 20:42:17 -0800
commitef6eba37636a487c0d6f3b93b8e76c94f28abbab (patch)
tree97e9674db3d81882b02fe5a990915b73f84017eb /src/model/misc.rs
parentAdd related projects to readme (diff)
downloadserenity-ef6eba37636a487c0d6f3b93b8e76c94f28abbab.tar.xz
serenity-ef6eba37636a487c0d6f3b93b8e76c94f28abbab.zip
Add emoji URL generation methods
Diffstat (limited to 'src/model/misc.rs')
-rw-r--r--src/model/misc.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/model/misc.rs b/src/model/misc.rs
index 0a07738..5d9017d 100644
--- a/src/model/misc.rs
+++ b/src/model/misc.rs
@@ -124,6 +124,15 @@ impl FromStr for RoleId {
}
}
+impl EmojiIdentifier {
+ /// Generates a URL to the emoji's image.
+ #[cfg(feature="methods")]
+ #[inline]
+ pub fn url(&self) -> String {
+ format!(cdn!("/emojis/{}.png"), self.id)
+ }
+}
+
impl FromStr for EmojiIdentifier {
type Err = ();
fn from_str(s: &str) -> StdResult<Self, ()> {