aegis.cpp
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Pages
reaction.hpp
1 //
2 // reaction.hpp
3 // ************
4 //
5 // Copyright (c) 2019 Sharon W (sharon at aegis dot gg)
6 //
7 // Distributed under the MIT License. (See accompanying file LICENSE)
8 //
9 
10 #pragma once
11 
12 #include "aegis/config.hpp"
13 #include "aegis/snowflake.hpp"
14 #include "emoji.hpp"
15 #include <nlohmann/json.hpp>
16 
17 namespace aegis
18 {
19 
20 namespace gateway
21 {
22 
23 namespace objects
24 {
25 
28 struct reaction
29 {
30  int32_t count = 0;
31  bool me = false;
33 };
34 
36 inline void from_json(const nlohmann::json& j, reaction& m)
37 {
38  m.count = j["count"];
39  m.me = j["me"];
40  m.emoji_ = j["emoji"];
41 }
43 
45 inline void to_json(nlohmann::json& j, const reaction& m)
46 {
47  j["count"] = m.count;
48  j["me"] = m.me;
49  j["emoji"] = m.emoji_;
50 }
52 
53 }
54 
55 }
56 
57 }
objects::emoji emoji_
Definition: reaction.hpp:32
bool me
Definition: reaction.hpp:31
Definition: reaction.hpp:28
int32_t count
Definition: reaction.hpp:30
Discord Emoji Object.
Definition: emoji.hpp:26