forked from rcxpony/sparkle
17 lines
751 B
C++
17 lines
751 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 nlohmann::json&) {
|
|
std::cout << DiscordEndpoints::details::latest << std::endl;
|
|
});
|
|
bot->on(GatewayEvents::MESSAGE_CREATE, [](const Discord<Message, User, Author, Message::Api>& msg) {
|
|
if (!msg.get<2>().isBot) {
|
|
msg.get<0>().send("939957962972229634", msg.get<0>().pack("content", msg.get<2>().avatar));
|
|
msg.get<0>().send("939957962972229634", msg.get<0>().pack("content", std::to_string(msg.get<3>().latency()) + "ms"));
|
|
}
|
|
});
|
|
bot->start();
|
|
return 0;
|
|
} |