Skip to content

Commit

Permalink
Fix ReactionType's Display impl to support animated emojis (#979)
Browse files Browse the repository at this point in the history
  • Loading branch information
u5surf authored Sep 30, 2020
1 parent 7396f4e commit f0a3947
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/model/channel/reaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,15 @@ impl Display for ReactionType {
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
match *self {
ReactionType::Custom {
animated,
id,
ref name,
..
ref name
} => {
f.write_char('<')?;
f.write_char(':')?;
if animated {
f.write_str("<a:")?;
} else {
f.write_str("<:")?;
}
f.write_str(name.as_ref().map_or("", |s| s.as_str()))?;
f.write_char(':')?;
Display::fmt(&id, f)?;
Expand Down

0 comments on commit f0a3947

Please sign in to comment.