forked from rcxpony/sparkle
25 lines
806 B
C++
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;
|
|
} |