1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
pub mod get_reactions;

mod create_reaction;
mod delete_all_reaction;
mod delete_all_reactions;
mod delete_reaction;

pub use self::{
    create_reaction::CreateReaction, delete_all_reaction::DeleteAllReaction,
    delete_all_reactions::DeleteAllReactions, delete_reaction::DeleteReaction,
    get_reactions::GetReactions,
};

use std::fmt::Write;
use twilight_model::channel::ReactionType;

fn format_emoji(emoji: ReactionType) -> String {
    match emoji {
        ReactionType::Custom { id, name, .. } => {
            let mut emoji = String::new();
            match name {
                Some(name) => emoji.push_str(name.as_ref()),
                None => emoji.push_str("e"),
            }
            let _ = write!(emoji, ":{}", id);

            emoji
        }
        ReactionType::Unicode { name } => name,
    }
}