summaryrefslogtreecommitdiff
path: root/bot/src/schemas
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-04-16 20:49:33 +0500
committerilotterytea <iltsu@alright.party>2025-04-16 23:04:52 +0500
commit5ca6a1c1ccfff28ff28f992a6d2231c49f7cabf9 (patch)
treea4634a327162a555eb14604c3dc6bb70437fecb6 /bot/src/schemas
parent52a6af6a2e5d64561a6a8a15c7e079fe46ffaa85 (diff)
feat: more string functions
Diffstat (limited to 'bot/src/schemas')
-rw-r--r--bot/src/schemas/stream.cpp16
-rw-r--r--bot/src/schemas/stream.hpp1
2 files changed, 17 insertions, 0 deletions
diff --git a/bot/src/schemas/stream.cpp b/bot/src/schemas/stream.cpp
index 34d170a..dbd5929 100644
--- a/bot/src/schemas/stream.cpp
+++ b/bot/src/schemas/stream.cpp
@@ -16,4 +16,20 @@ namespace bot::schemas {
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";
+ }
+ }
}
diff --git a/bot/src/schemas/stream.hpp b/bot/src/schemas/stream.hpp
index 0811561..9763ba9 100644
--- a/bot/src/schemas/stream.hpp
+++ b/bot/src/schemas/stream.hpp
@@ -5,6 +5,7 @@
namespace bot::schemas {
enum EventType { LIVE, OFFLINE, TITLE, GAME, GITHUB = 10, CUSTOM = 99 };
EventType string_to_event_type(const std::string &type);
+ std::string event_type_to_string(const int &type);
enum EventFlag { MASSPING };