2025-01-15 13:34:41 +05:00
|
|
|
#include <api.h>
|
|
|
|
#include <includes.h>
|
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;
|
2025-01-20 00:03:53 +05:00
|
|
|
WebSocket* bot = &WebSocket::getInstance(argv[2], GatewayIntents::AllIntents);
|
2025-01-20 16:07:42 +05:00
|
|
|
bot->on(GatewayEvents::READY, [](const Discord<Message, User>& a) {
|
|
|
|
std::cout << DiscordEndpoints::details::latest << std::endl;
|
2025-01-20 00:03:53 +05:00
|
|
|
});
|
2025-01-20 03:09:27 +05:00
|
|
|
bot->on(GatewayEvents::MESSAGE_CREATE, [bot](const Discord<Message, User, Author>& msg) {
|
2025-01-20 16:07:42 +05:00
|
|
|
if (msg.get<2>().isBot == false) {
|
|
|
|
msg.get<0>().send("939957962972229634", msg.get<0>().pack("content", msg.get<2>().global_name));
|
|
|
|
}
|
2025-01-18 00:13:18 +05:00
|
|
|
});
|
2024-12-31 02:20:56 +05:00
|
|
|
bot->start();
|
|
|
|
return 0;
|
2025-01-20 00:03:53 +05:00
|
|
|
}
|