DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
discord_core_api::discord_core_client Class Reference

discord_core_client - the main class for this library. More...

#include <DiscordCoreClient.hpp>

Public Member Functions

 discord_core_client (const discord_core_client_config &configData)
 discord_core_client constructor. More...
 
command_controllergetCommandController ()
 For collecting a reference to the command_controller. More...
 
const config_manager & getConfigManager () const
 For collecting a reference to the config_manager. More...
 
event_managergetEventManager ()
 For collecting a reference to the event_manager. More...
 
milliseconds getTotalUpTime ()
 For collecting, the total time in milliseconds that this bot has been up for. More...
 
void registerFunction (const jsonifier::vector< jsonifier::string > &functionNames, unique_ptr< base_function > baseFunction, create_application_command_data commandData, bool alwaysRegister=false)
 For registering a function with the command_controller. More...
 
void runBot ()
 Executes the library, and waits for completion.
 

Static Public Member Functions

static bot_user getBotUser ()
 For collecting a copy of the current bot's user_data. More...
 

Constructor & Destructor Documentation

◆ discord_core_client()

discord_core_api::discord_core_client::discord_core_client ( const discord_core_client_config configData)
Parameters
configDataa discord_core_client_config structure to select various library options.

Definition at line 113 of file DiscordCoreClient.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ getBotUser()

bot_user discord_core_api::discord_core_client::getBotUser ( )
static
Returns
bot_user an instance of bot_user.

Definition at line 153 of file DiscordCoreClient.cpp.

Here is the caller graph for this function:

◆ getCommandController()

command_controller & discord_core_api::discord_core_client::getCommandController ( )
Returns
command_controller& a reference to the command_controller.

Definition at line 182 of file DiscordCoreClient.cpp.

◆ getConfigManager()

const config_manager & discord_core_api::discord_core_client::getConfigManager ( ) const
Returns
config_manager& a reference to the config_manager.

Definition at line 149 of file DiscordCoreClient.cpp.

◆ getEventManager()

event_manager & discord_core_api::discord_core_client::getEventManager ( )
Returns
event_manager& a reference to the event_manager.

Definition at line 186 of file DiscordCoreClient.cpp.

◆ getTotalUpTime()

milliseconds discord_core_api::discord_core_client::getTotalUpTime ( )
Returns
milliseconds a size, in milliseconds, since the bot has come online.

Definition at line 190 of file DiscordCoreClient.cpp.

◆ registerFunction()

void discord_core_api::discord_core_client::registerFunction ( const jsonifier::vector< jsonifier::string > &  functionNames,
unique_ptr< base_function baseFunction,
create_application_command_data  commandData,
bool  alwaysRegister = false 
)
Parameters
functionNamesa vector containing the possible names for activating this command/function.
baseFunctiona unique_ptr to the command to be registered.
commandDataa create_application_command_data structure describing the current function.
alwaysRegisterwhether or not it gets registered every time the bot boots up, or only when it's missing from the bot's list of registered commands.

Definition at line 175 of file DiscordCoreClient.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: