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-18 01:01:19 +05:00

18 lines
702 B
C++

#include <api.h>
#include <includes.h>
int main(int argc, char* argv[]) {
if (argc != 3) return -1;
WebSocket* bot = &WebSocket::getInstance(argv[2], GatewayIntents::AllIntents);
bot->on(GatewayEvents::READY, [](const Bot<Message, User, Author>& msg) {
if (!g(2, msg.net)->isBot()) {
cout << g(0, msg.net)->send("939957962972229634", j("content", "asd")) << endl;
}
});
bot->on(GatewayEvents::MESSAGE_CREATE, [](const Bot<Message, User, Author>& msg) {
if (!g(2, msg.net)->isBot()) {
cout << g(0, msg.net)->send("939957962972229634", j("content", g(2, msg.net)->content())) << endl;
}
});
bot->start();
return 0;
}