summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoderndevslulw <moderndevslulw@alright.party>2025-04-03 01:11:25 +0500
committermoderndevslulw <moderndevslulw@alright.party>2025-04-03 01:11:25 +0500
commitee132dc6c326708706e0c88ba234a90aec7ee936 (patch)
tree86bb6cf9422d5e313ef20c951d29edb960ed92d8
parent53b6600cbaa059d2220c3755e054a51c13558151 (diff)
feat: Emote struct and a base class for emote websockets
-rw-r--r--include/emotespp/emotes.hpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/emotespp/emotes.hpp b/include/emotespp/emotes.hpp
new file mode 100644
index 0000000..5a5e172
--- /dev/null
+++ b/include/emotespp/emotes.hpp
@@ -0,0 +1,48 @@
+#pragma once
+
+#include <functional>
+#include <optional>
+#include <string>
+
+namespace emotespp {
+ struct Emote {
+ std::string id;
+ std::string code;
+ std::optional<std::string> original_code;
+ };
+
+ template <typename T>
+ class RetrieveEmoteWebsocket {
+ public:
+ void on_emote_create(
+ std::function<void(std::string, std::optional<std::string>, T)>
+ func) {
+ this->emote_create = func;
+ }
+
+ void on_emote_delete(
+ std::function<void(std::string, std::optional<std::string>, T)>
+ func) {
+ this->emote_delete = func;
+ }
+
+ void on_emote_update(
+ std::function<void(std::string, std::optional<std::string>, T)>
+ func) {
+ this->emote_update = func;
+ }
+
+ protected:
+ std::optional<
+ std::function<void(std::string, std::optional<std::string>, T)>>
+ emote_create;
+
+ std::optional<
+ std::function<void(std::string, std::optional<std::string>, T)>>
+ emote_delete;
+
+ std::optional<
+ std::function<void(std::string, std::optional<std::string>, T)>>
+ emote_update;
+ };
+} \ No newline at end of file