Skip to content

nkss-dev/Project-Hyperlink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Hyperlink

Python 3.11 Built with Nix

A personal moderation bot made as a part of the NKSS project

NOTE

This repository is now in maintenance mode; meaning, new features will not be added but bug fixes will be released as detected.

Running a local instance

Ideally, you'd invite my instance of the bot. This allows it to always stay online and receive updates as they roll out.

Nevertheless, here are the installation steps:

  1. Clone the repository: git clone https://github.com/nkss-dev/Project-Hyperlink.git

  2. Installation:

    • Install nix: the package manager if you haven't already.
    • Run nix develop to enter the shell environment which will auto-magically install all our required dependencies (including Python!).
    • If you prefer, we also support direnv for setting up the shell environment.

    NOTE: The above process only works on non-Windows systems (Windows as well IF you use WSL2). If you want to install this on Windows (please don't), refer the steps in the closed summary below:

    Windows install without WSL2
    • Ensure that you have Python 3.10 or higher.
    • Set up the virtual environment: python3 -m venv hyperlink-env
      To activate this environment:
      • using Command Prompt, run: hyperlink-env\Scripts\activate.bat
      • using PowerShell, run: hyperlink-env\Scripts\Activate.ps1
    • Install the dependencies: pip install -U -r requirements.txt
  3. Configuration:

    Following are the environment variables needed for this project. You can paste these into an .env file and it will auto-load.

    # Token
    BOT_TOKEN=""
    
    # Developer options
    TESTING_MODE=1
    TESTING_BOT_TOKEN=""
    LOG_URL="https://discord.com/api/webhooks/.../..."
    
    # API
    BREADBOARD_API_TOKEN=""
    
    # Email
    EMAIL_ADDRESS="[email protected]"
    EMAIL_PASSWORD=""
    
    # PostgreSQL
    PGDATABASE=""
    PGHOST=""
    PGPASSWORD=""
    PGPORT=""
    PGUSER=""
    
    # Google Drive API
    GOOGLE_CLIENT_ID="<id>.apps.googleusercontent.com"
    GOOGLE_CLIENT_SECRET="GOCSPX-..."
    GOOGLE_REFRESH_TOKEN="" # the app will tell you what to put here

    Additionally, there are some non-secret configuration options in config.py, you may want to look at those too.

    Note: Some of these are optional, but may break the bot's functionality, if left empty.

  4. For drive.py:
    Follow the instructions given here and store the resultant .json file in the db folder (generated automatically after the bot is run at least once) and rename it to credentials.json

  5. Run python src/main.py