2025-01-15 13:34:41 +05:00
|
|
|
#include <api.h>
|
|
|
|
#include <includes.h>
|
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;
|
2025-01-18 01:01:19 +05:00
|
|
|
WebSocket* bot = &WebSocket::getInstance(argv[2], GatewayIntents::AllIntents);
|
|
|
|
bot->on(GatewayEvents::READY, [](const Bot<Message, User, Author>& msg) {
|
2025-01-14 05:18:08 +05:00
|
|
|
if (!g(2, msg.net)->isBot()) {
|
2025-01-18 01:01:19 +05:00
|
|
|
cout << g(0, msg.net)->send("939957962972229634", j("content", "asd")) << endl;
|
2024-12-31 02:20:56 +05:00
|
|
|
}
|
|
|
|
});
|
2025-01-18 00:13:18 +05:00
|
|
|
bot->on(GatewayEvents::MESSAGE_CREATE, [](const Bot<Message, User, Author>& msg) {
|
|
|
|
if (!g(2, msg.net)->isBot()) {
|
2025-01-18 01:01:19 +05:00
|
|
|
cout << g(0, msg.net)->send("939957962972229634", j("content", g(2, msg.net)->content())) << endl;
|
2025-01-18 00:13:18 +05:00
|
|
|
}
|
|
|
|
});
|
2024-12-31 02:20:56 +05:00
|
|
|
bot->start();
|
|
|
|
return 0;
|
2025-01-17 23:28:40 +05:00
|
|
|
}
|