forked from rcxpony/sparkle
rpc
This commit is contained in:
parent
90e311c01a
commit
0a3f012f1d
@ -141,7 +141,6 @@ private:
|
|||||||
heartbeat_interval = res["d"]["heartbeat_interval"].get<int>();
|
heartbeat_interval = res["d"]["heartbeat_interval"].get<int>();
|
||||||
!connected ? connected = true, webSocket.send(id.dump()) : false;
|
!connected ? connected = true, webSocket.send(id.dump()) : false;
|
||||||
start_heartbeat();
|
start_heartbeat();
|
||||||
//test();
|
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
if (eventHandlers.find(res["t"].get<std::string>()) != eventHandlers.end()) {
|
if (eventHandlers.find(res["t"].get<std::string>()) != eventHandlers.end()) {
|
||||||
@ -158,8 +157,8 @@ public:
|
|||||||
json prsUpdate = {
|
json prsUpdate = {
|
||||||
{"op", 3},
|
{"op", 3},
|
||||||
{"d", {
|
{"d", {
|
||||||
{"since", 9187921},
|
{"since", 0},
|
||||||
{"activities", json::array({{"name", activityName}, {"type", statusType}})},
|
{"activities", json::array({{"name", activityName}, {"type", 2}})},
|
||||||
{"status", statusType == 1 ? "online" : "idle"},
|
{"status", statusType == 1 ? "online" : "idle"},
|
||||||
{"afk", false}
|
{"afk", false}
|
||||||
}}
|
}}
|
||||||
|
@ -100,4 +100,12 @@ enum GatewayIntents {
|
|||||||
GuildWebhooks = 32,
|
GuildWebhooks = 32,
|
||||||
MessageContent = 32768
|
MessageContent = 32768
|
||||||
};
|
};
|
||||||
|
enum UserStatus {
|
||||||
|
Offline,
|
||||||
|
Online,
|
||||||
|
Idle,
|
||||||
|
AFK,
|
||||||
|
DoNotDisturb,
|
||||||
|
Invisible
|
||||||
|
};
|
||||||
#endif
|
#endif
|
@ -17,12 +17,13 @@ int main(int argc, char* argv[]) {
|
|||||||
bot->once(GatewayEvents::READY, [](const Bot<json>& b) {
|
bot->once(GatewayEvents::READY, [](const Bot<json>& b) {
|
||||||
cout << "started" << endl;
|
cout << "started" << endl;
|
||||||
});
|
});
|
||||||
bot->on(GatewayEvents::MESSAGE_CREATE, [](const Bot<json, Message, Author, EmbedBuilder>& msg) {
|
bot->on(GatewayEvents::MESSAGE_CREATE, [bot](const Bot<json, Message, Author, EmbedBuilder>& msg) {
|
||||||
if (g(2, msg.net)->isBot() == false) {
|
if (g(2, msg.net)->isBot() == false) {
|
||||||
cout << g(1, msg.net)->send("939957962972229634", j("content", "test")) << endl;
|
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<Message>& msg) {
|
bot->on(GatewayEvents::MESSAGE_REACTION_REMOVE, [bot](const Bot<Message>& msg) {
|
||||||
g(0, msg.net)->send("939957962972229634", j("content", "bye"));
|
g(0, msg.net)->send("939957962972229634", j("content", "bye"));
|
||||||
});
|
});
|
||||||
bot->on(GatewayEvents::MESSAGE_REACTION_ADD, [](const Bot<Message>& msg) {
|
bot->on(GatewayEvents::MESSAGE_REACTION_ADD, [](const Bot<Message>& msg) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user