forked from rcxpony/sparkle
16 lines
633 B
C++
16 lines
633 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 Discord<Message, User>& a) {
|
|
std::cout << DiscordEndpoints::details::latest << std::endl;
|
|
});
|
|
bot->on(GatewayEvents::MESSAGE_CREATE, [bot](const Discord<Message, User, Author>& msg) {
|
|
if (msg.get<2>().isBot == false) {
|
|
msg.get<0>().send("939957962972229634", msg.get<0>().pack("content", msg.get<2>().global_name));
|
|
}
|
|
});
|
|
bot->start();
|
|
return 0;
|
|
} |