Skip to content

Cordactyl/Central-Discord-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordactyl.com Official Discord-Bot

This is the Open-Source Discord-Bot used for the central cordactyl.com panel written in C++. It can be used for individual tenants.

Getting Started

Requirements

Build requirements

  • cmake (version 3.15+)
  • g++ (version 14 or higher)

Included dependencies (in the /libs folder)

  • DPP (version 10.1.2)

External Dependencies (Must be installed)

  • OpenSSL (For HTTPS, will use whichever -dev package comes with your OS)
  • zlib (For websocket compression, will use whichever -dev package comes with your OS)

Create a Discord-Bot

Go to the discord developer portal and create a Discord-Bot. The Discord Bot needs at least the Server Members intent along with the following permissions:

  • Send Messages
  • Embed Links

For the discord Oauth2 login to work, you need to configure the following Oauth2 authentication redirect: https://cordactyl.com/discord-login in the "OAuth2" section.

Installation

Build instructions for Linux:

First, download the project, for example via git clone https://gitlab.com/cordactyl/discord-bot.git.

Navigate into the project directory and execute the following commands:

mkdir build
cd build
cmake ..
make -j8

Tip: Replace the number after -j with the number of CPU cores available on your machine for optimal performance.

After the build process completes, an executable named Cordactyl_Bot will be generated. You can execute this executable to start the Discord bot.

Before running the bot, make sure to set the following environment variables:

  • BOT_TOKEN
  • API_TOKEN

For more detailed instructions and information tailored to your operating system, refer to the D++ library documentation.

Suggestion to run the bot

On a linux server, you can use the following service file to run the bot in a systemd daemon.

[Unit]
Description=Cordactyl Discord-Bot
After=network.target

[Service]
Type=simple
WorkingDirectory=/path_to_project
ExecStart=/build/Cordactyl_Bot
Environment="BOT_TOKEN=paste_your_discord_bot_token_here"
Environment="API_TOKEN=paste_your_cordactyl_api_token_here"
Restart=always
# exits with code 24 on invalid api token
RestartPreventExitStatus=24
User=cordactyl # If you have setup a custom user for the discord-bot

[Install]
WantedBy=multi-user.target

Localisation

Translations are stored in the lang directory. Each language file must have a locale name from this list.

Get in touch

If you want to contribute, just get in touch via our Discord Server.

Roadmap

  • Implementing a ticket system
  • Adding a social score system
  • Moderation features

Contributing

Issues and feature requests are welcome. Feel free to contribute if you're interested!

License

This project is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License (CC BY-NC-ND 4.0).

What does this mean?

  • Attribution (BY): You must give appropriate credit when using or referencing this work.
  • NonCommercial (NC): You may not use this work for commercial purposes.
  • NoDerivatives (ND): You may not distribute modified versions of this work.

Permissions

You are free to:

  • View, download, and use the source code for personal and non-commercial purposes.

Restrictions

  • You may not modify and redistribute this project or any derivatives.
  • Commercial use is strictly prohibited.

For more details, see the full license at: https://creativecommons.org/licenses/by-nc-nd/4.0/.

Show your kindness

Be sure to leave a ⭐️ if you like the project :) Thank you!