DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
Running a Function on a Timer

// main.cpp - main entry point.
// jun 17, 2021
// real_time_chris
// https://github.com/RealTimeChris
#include "commands/commands_list.hpp"
void onBoot00(discord_core_client* args) {
auto botUser = args->getBotUser();
database_manager_agent::initialize(botUser.id);
discord_user user{ botUser.userName, botUser.id };
}
int32_t main() {
jsonifier::vector<discord_core_api::repeated_function_data> functionVector{};
repeated_function_data function01{};
function01.function = &onBoot00;
function01.intervalInMs = 150;
function01.repeated = false;
functionVector.pushBack(function01);
discord_core_client_config clientConfig{};
clientConfig.functionsToExecute = functionVector;
auto ptr = makeUnique<discord_core_client>(clientConfig);
ptr->runBot();
return 0;
}