Project setup - HexCorpProgramming/HexCorpDiscordAI GitHub Wiki

This is intended as a step by step instruction to setting up your environment for working on the HexCorpDiscordAI.

Requirements

  • Python 3.8+ and pip (usually bundled with Python)
  • Visual Studio Code
  • git

Setup

Get added to the GitHub project

If you want to push changes to the repository, you will have to be added to the project by the Hive Mxtress. Mention them in the development channels with a request to be added to the project and the name of your GitHub account. Remember, other people might be able to see that you contributed to this project with this account.

You will then receive an email to the address linked to that GitHub account with a link to acknowledge the invitation.

Installing dependencies

To install all the necessary libraries use pip install -r requirements.txt -r dev_requirements.txt in the project root directory.

Join the dev server

We have a separate development server on discord to test new features.

Before joining the dev server you should launch the QA instance of the bot using the The HexCorp QA Instance Mxtress AI Deployment Interface which is linked in the discord channel bot-qa-guide.

An invite link to the development server can be found in the bot-dev-guide channel.

Please stop the QA instance of the bot after joining the server.

Launching the AI

Acquire the current bot access token, necessary to log in to discord from the discord channel bot-dev-guide. Please do not communicate this token to people outside the project.

Then run python main.py <BOT_TOKEN> (replace <BOT_TOKEN> with the actual token) in the project root to start the AI. You should now be able to see the AI being online in the dev server.

(Optional) VSCode Launch Target

It is recommended to use a launch target to launch the AI instead of launching it from the command line. A launch target enables you to use breakpoints in VSCode and also makes it easier to launch, stop and restart it.

Put the following into .vscode/launch.json in the project directory.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug Application",
            "type": "debugpy",
            "request": "launch",
            "module": "main",
            "justMyCode": false,
            "args": ["<BOT_TOKEN>"]
        },
        {
            "name": "Debug Unit Tests",
            "type": "debugpy",
            "request": "launch",
            "module": "unittest",
            "justMyCode": false,
            "args": ["test/test_<...>.py"]
        }
    ]
}
⚠️ **GitHub.com Fallback** ⚠️