diff --git a/libs/gateway/websocket.hpp b/libs/gateway/websocket.hpp index 72ae57d..df184b8 100644 --- a/libs/gateway/websocket.hpp +++ b/libs/gateway/websocket.hpp @@ -141,7 +141,6 @@ private: heartbeat_interval = res["d"]["heartbeat_interval"].get(); !connected ? connected = true, webSocket.send(id.dump()) : false; start_heartbeat(); - //test(); break; case 0: if (eventHandlers.find(res["t"].get()) != eventHandlers.end()) { @@ -158,8 +157,8 @@ public: json prsUpdate = { {"op", 3}, {"d", { - {"since", 9187921}, - {"activities", json::array({{"name", activityName}, {"type", statusType}})}, + {"since", 0}, + {"activities", json::array({{"name", activityName}, {"type", 2}})}, {"status", statusType == 1 ? "online" : "idle"}, {"afk", false} }} diff --git a/libs/utils/enums.hpp b/libs/utils/enums.hpp index dad4616..162444a 100644 --- a/libs/utils/enums.hpp +++ b/libs/utils/enums.hpp @@ -100,4 +100,12 @@ enum GatewayIntents { GuildWebhooks = 32, MessageContent = 32768 }; +enum UserStatus { + Offline, + Online, + Idle, + AFK, + DoNotDisturb, + Invisible +}; #endif \ No newline at end of file diff --git a/sources/main.cpp b/sources/main.cpp index bfafe2d..422b041 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -17,12 +17,13 @@ int main(int argc, char* argv[]) { bot->once(GatewayEvents::READY, [](const Bot& b) { cout << "started" << endl; }); - bot->on(GatewayEvents::MESSAGE_CREATE, [](const Bot& msg) { + bot->on(GatewayEvents::MESSAGE_CREATE, [bot](const Bot& msg) { if (g(2, msg.net)->isBot() == false) { cout << g(1, msg.net)->send("939957962972229634", j("content", "test")) << endl; } + //bot->sendPresenceUpdate(UserStatus::Online, "sd"); }); - bot->once(GatewayEvents::MESSAGE_REACTION_REMOVE, [bot](const Bot& msg) { + bot->on(GatewayEvents::MESSAGE_REACTION_REMOVE, [bot](const Bot& msg) { g(0, msg.net)->send("939957962972229634", j("content", "bye")); }); bot->on(GatewayEvents::MESSAGE_REACTION_ADD, [](const Bot& msg) {