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
fluttershy 7f6b7e4bb6 fixes
2025-01-14 16:14:01 +05:00

21 lines
722 B
C++

#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 <gateway/Websocket.hpp>
#include <tls/Network.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>& 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;
}
});
bot->start();
return 0;
}