diff options
| author | Fenhl <[email protected]> | 2017-11-13 12:39:53 +0000 |
|---|---|---|
| committer | alex <[email protected]> | 2017-11-13 13:39:53 +0100 |
| commit | 68156c9ce93edc86a70f50cf10986615cfb9f93a (patch) | |
| tree | 7ead51d5fa47d48ffe3041b0964c672669e0e609 /src/model | |
| parent | Change PrivateChannel::say to use `Display` (#214) (diff) | |
| download | serenity-68156c9ce93edc86a70f50cf10986615cfb9f93a.tar.xz serenity-68156c9ce93edc86a70f50cf10986615cfb9f93a.zip | |
Implement From<EmojiId | EmojiIdentifier> for ReactionType (#217)
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/channel/reaction.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/model/channel/reaction.rs b/src/model/channel/reaction.rs index 7b93716..cf7963f 100644 --- a/src/model/channel/reaction.rs +++ b/src/model/channel/reaction.rs @@ -255,6 +255,24 @@ impl From<Emoji> for ReactionType { } } +impl From<EmojiId> for ReactionType { + fn from(emoji_id: EmojiId) -> ReactionType { + ReactionType::Custom { + id: emoji_id, + name: None + } + } +} + +impl From<EmojiIdentifier> for ReactionType { + fn from(emoji_id: EmojiIdentifier) -> ReactionType { + ReactionType::Custom { + id: emoji_id.id, + name: Some(emoji_id.name) + } + } +} + impl From<String> for ReactionType { fn from(unicode: String) -> ReactionType { ReactionType::Unicode(unicode) } } |