27 lines
985 B
C++
27 lines
985 B
C++
#include "ready.h"
|
|
|
|
const std::chrono::seconds statusChangeInterval(15);
|
|
|
|
std::thread ready::get_status_thread(dpp::cluster &bot) {
|
|
return std::thread([&bot]() {
|
|
while (true) {
|
|
bot.set_presence(dpp::presence(dpp::ps_online, dpp::at_watching, "support.sheepstar.xyz"));
|
|
std::this_thread::sleep_for(statusChangeInterval);
|
|
|
|
bot.set_presence(dpp::presence(dpp::ps_online, dpp::at_listening, "/help"));
|
|
std::this_thread::sleep_for(statusChangeInterval);
|
|
|
|
bot.set_presence(dpp::presence(dpp::ps_online, dpp::at_watching, "sheepstar.xyz"));
|
|
std::this_thread::sleep_for(statusChangeInterval);
|
|
}
|
|
});
|
|
}
|
|
|
|
void ready::execute(dpp::cluster &bot, const dpp::ready_t &event) {
|
|
std::cout << "Logged in as " << event.from->creator->me.username << " (" << event.from->creator->me.id << ")"
|
|
<< std::endl;
|
|
|
|
std::thread status_thread = get_status_thread(bot);
|
|
status_thread.join();
|
|
}
|