blob: dbd59292b7b5429c07709e802d3f6cc633f6f372 (
plain)
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
|
#include "stream.hpp"
namespace bot::schemas {
EventType string_to_event_type(const std::string &type) {
if (type == "live") {
return EventType::LIVE;
} else if (type == "offline") {
return EventType::OFFLINE;
} else if (type == "title") {
return EventType::TITLE;
} else if (type == "game") {
return EventType::GAME;
} else if (type == "github") {
return EventType::GITHUB;
} else {
return EventType::CUSTOM;
}
}
std::string event_type_to_string(const int &type) {
if (type == LIVE) {
return "live";
} else if (type == OFFLINE) {
return "offline";
} else if (type == TITLE) {
return "title";
} else if (type == GAME) {
return "game";
} else if (type == GITHUB) {
return "github";
} else {
return "custom";
}
}
}
|