sparkle/sources/main.cpp

25 lines
818 B
C++
Raw Normal View History

2024-12-31 02:20:56 +05:00
#define RELEASE
#include <utils/json.hpp>
#include <utils/enums.hpp>
2025-01-13 14:40:21 +05:00
#include <tls/Network.hpp>
#include <gateway/Websocket.hpp>
2024-12-31 02:20:56 +05:00
#include <utils/types.hpp>
#include <api/Bot.hpp>
#include <api/Channel.hpp>
#include <api/Message.hpp>
#include <api/Embed.hpp>
#include <api/Author.hpp>
2025-01-13 14:40:21 +05:00
#include <api/User.hpp>
2024-12-31 02:20:56 +05:00
#include <utils/types.hpp>
2024-12-31 04:46:39 +05:00
int main(int argc, char* argv[]) {
2025-01-13 14:40:21 +05:00
if (argc != 3) return -1;
WebSocket* bot = &WebSocket::getInstance(argv[2], 131071);
2025-01-14 05:18:08 +05:00
bot->on(GatewayEvents::MESSAGE_CREATE, [](const Bot<Message, User, Author>& msg) {
if (!g(2, msg.net)->isBot()) {
g(0, msg.net)->send("939957962972229634", j("content", g(2, msg.net)->content()));
//cout << g(1, msg.net)->extract({ "content" }).get<string>() << endl;
2024-12-31 02:20:56 +05:00
}
});
bot->start();
return 0;
}