You need to set the DISCORD_BOT_TOKEN environment variable in your build environment. To do this, run:
export DISCORD_BOT_TOKEN="your_token_here"Do not share your token!
Most of the configarable parameters are located in globals.h, and in the main function.
Follow these steps to clone the repository, create a build directory, configure the project with CMake, and build the project:
-
Clone the Repository:
git clone https://github.com/lukacsi/jocika
This command clones the
jocikarepository from GitHub to your local machine. -
Navigate to the Project Directory:
cd jocikaChange your current directory to the cloned
jocikadirectory. -
Create the Build Directory:
mkdir build
It's a good practice to perform out-of-source builds. This command creates a separate
builddirectory. -
Configure the Project with CMake:
cmake -B build
This command configures the project using CMake, generating the necessary build files in the
builddirectory. -
Build the Project:
cmake --build build
This command compiles the project based on the generated build files.
Easy to copy format:
git clone https://github.com/lukacsi/jocika
cd joci
mkdir build
cmake -B build
cmake --build buildAfter successfully building the project, you can run the executable with the following commands:
cd build
./jocika-
Verify Environment Variable: Before running the bot, you can verify that the environment variable is set correctly:
echo $DISCORD_BOT_TOKEN
-
Persistent Environment Variable: If you want the
DISCORD_BOT_TOKENto persist across sessions, consider adding the export command to your shell's configuration file (e.g.,.bashrc,.zshrc):echo 'export DISCORD_BOT_TOKEN="your_token_here"' >> ~/.bashrc source ~/.bashrc