This repository has been archived on 2025-03-15. You can view files and clone it, but cannot push or open issues or pull requests.
sparkle/sources/main.cpp
2025-01-13 22:30:24 +05:00

25 lines
806 B
C++

#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 <api/User.hpp>
#include <utils/types.hpp>
int main(int argc, char* argv[]) {
if (argc != 3) return -1;
WebSocket* bot = &WebSocket::getInstance(argv[2], 131071);
bot->on(GatewayEvents::MESSAGE_CREATE, [](const Bot<Message, User, Author>& b) {
if (!g(2, b.net)->isBot()) {
g(0, b.net)->send("939957962972229634", j("content", g(2, b.net)->content()));
cout << g(1, b.net)->extract({ "content" }).get<string>() << endl;
}
});
bot->start();
return 0;
}