2024-12-31 02:20:56 +05:00
|
|
|
#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>
|
2025-01-14 16:14:01 +05:00
|
|
|
#include <gateway/Websocket.hpp>
|
|
|
|
#include <tls/Network.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;
|
|
|
|
}
|