aboutsummaryrefslogtreecommitdiff
path: root/src/http/utils.rs
blob: 017fe0e3bb98f4edb675ee337443ca0f84083974 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
use model::channel::ReactionType;

pub fn reaction_type_data(reaction_type: &ReactionType) -> String {
    match *reaction_type {
        ReactionType::Custom {
            id,
            ref name,
            ..
        } => format!("{}:{}", name.as_ref().map_or("", |s| s.as_str()), id),
        ReactionType::Unicode(ref unicode) => unicode.clone(),
    }
}