-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemoji.rs
More file actions
87 lines (80 loc) · 2.24 KB
/
emoji.rs
File metadata and controls
87 lines (80 loc) · 2.24 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
use crate::bot_utils;
use serenity::model::channel::ReactionType;
use serenity::model::id::EmojiId;
use std::string::ToString;
fn get_plus_two() -> ReactionType {
let plus_two: ReactionType = ReactionType::Custom {
animated: false,
id: EmojiId::new(924536822472802337),
name: Some("p2".to_string()),
};
plus_two
}
fn get_minus_two() -> ReactionType {
let minus_two: ReactionType = ReactionType::Custom {
animated: false,
id: EmojiId::new(924536784191365120),
name: Some("m2".to_string()),
};
minus_two
}
fn get_manny() -> ReactionType {
let manny: ReactionType = ReactionType::Custom {
animated: false,
id: EmojiId::new(929987409360343051),
name: Some("manny".to_string()),
};
manny
}
fn get_doot() -> ReactionType {
let doot: ReactionType = ReactionType::Custom {
animated: false,
id: EmojiId::new(929985012554682469),
name: Some("doot".to_string()),
};
doot
}
fn get_winner() -> ReactionType {
let winner: ReactionType = ReactionType::Custom {
animated: false,
id: EmojiId::new(1348181039779938366),
name: Some("winner".to_string()),
};
winner
}
fn get_blessed() -> ReactionType {
let blessed: ReactionType = ReactionType::Custom {
animated: false,
id: EmojiId::new(877421904158412810),
name: Some("blessed".to_string()),
};
blessed
}
pub fn points_from_reaction(reaction: &ReactionType) -> i16 {
let ReactionType::Custom { id, .. } = reaction else {
return 0;
};
match id.get() {
924536822472802337 | 929987409360343051 => 2,
924536784191365120 | 929985012554682469 => -2,
_ => 0,
}
}
pub fn get_emoji(emoji_name: &str) -> ReactionType {
let current_env = bot_utils::get_env();
if String::from("live").eq(¤t_env) {
match emoji_name {
"minus_two" => get_minus_two(),
"plus_two" => get_plus_two(),
"winner" => get_winner(),
_ => get_plus_two(),
}
} else {
match emoji_name {
"doot" => get_doot(),
"manny" => get_manny(),
"winner" => get_doot(),
_ => get_blessed(),
}
}
}