33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
#define RELEASE
|
|
#include <utils/json.hpp>
|
|
#include <random>
|
|
#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 <utils/types.hpp>
|
|
using namespace std;
|
|
int main() {
|
|
WebSocket* bot = WebSocket::getInstance(TOKEN_BOT, ALL_INTENTS);
|
|
bot->once(GatewayEvents::READY, [](const Bot<json>& b) {
|
|
cout << "started" << endl;
|
|
});
|
|
bot->on(GatewayEvents::MESSAGE_CREATE, [bot](const Bot<json, Message, Author, EmbedBuilder>& msg) {
|
|
if (g(2, msg.net)->isBot() == false) {
|
|
cout << g(1, msg.net)->send("939957962972229634", j("content", "test")) << endl;
|
|
}
|
|
});
|
|
bot->on(GatewayEvents::GUILD_MEMBER_REMOVE, [](const Bot<Message>& msg) {
|
|
g(0, msg.net)->send("939957962972229634", j("content", "bye"));
|
|
});
|
|
bot->on(GatewayEvents::GUILD_MEMBER_ADD, [](const Bot<Message>& msg) {
|
|
g(0, msg.net)->send("939957962972229634", j("content", "hello"));
|
|
});
|
|
bot->start();
|
|
return 0;
|
|
} |