2025-01-25 13:22:59 +05:00
|
|
|
#include <api.hpp>
|
|
|
|
#include <includes.hpp>
|
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 15:07:30 +05:00
|
|
|
WebSocket* bot = &WebSocket::getInstance(argv[2], GatewayIntents::AllIntents);
|
2025-01-25 12:23:31 +05:00
|
|
|
bot->on(GatewayEvents::READY, [](const nlohmann::json&) {
|
2025-01-25 11:24:56 +05:00
|
|
|
std::cout << DiscordEndpoints::details::latest << std::endl;
|
2025-01-19 04:41:20 +05:00
|
|
|
});
|
2025-01-25 15:46:27 +05:00
|
|
|
bot->on(GatewayEvents::MESSAGE_CREATE, [](const Discord<Message, User, Author, Message::Api>& ctx) {
|
|
|
|
if (!ctx.get<Author>().isBot) {
|
|
|
|
ctx.get<Message>().send("939957962972229634", ctx.get<Message>().pack("content", ctx.get<Author>().avatar));
|
2025-01-25 11:24:56 +05:00
|
|
|
}
|
2025-01-18 00:13:18 +05:00
|
|
|
});
|
2024-12-31 02:20:56 +05:00
|
|
|
bot->start();
|
|
|
|
return 0;
|
2025-01-19 04:41:20 +05:00
|
|
|
}
|