#define RELEASE #include <utils/json.hpp> #include <utils/enums.hpp> #include <tls/network.hpp> #include <gateway/websocket.hpp> #include <utils/types.hpp> #include <api/Bot.hpp> #include <api/Channel.hpp> #include <api/Message.hpp> #include <api/Embed.hpp> #include <api/Author.hpp> #include <utils/types.hpp> using namespace std; int main(int argc, char* argv[]) { if (argc != 5) return -1; WebSocket* bot = WebSocket::getInstance(argv[2], stoi(argv[4]), true); bot->on(GatewayEvents::READY, [](const Bot<Message>& b) { cout << "started" << endl; }); bot->on(GatewayEvents::MESSAGE_CREATE, [bot](const Bot<json, Message, Author, EmbedBuilder>& msg) { if (g(2, msg.net)->isBot() == false) { g(1, msg.net)->send("939957962972229634", j("content", g(2, msg.net)->content())); } }); bot->on(GatewayEvents::MESSAGE_REACTION_REMOVE, [bot](const Bot<Message>& msg) { g(0, msg.net)->send("939957962972229634", j("content", "bye")); }); bot->on(GatewayEvents::MESSAGE_REACTION_ADD, [](const Bot<Message>& msg) { g(0, msg.net)->send("939957962972229634", j("content", "hello")); }); bot->start(); return 0; }