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