A personal moderation bot made as a part of the NKSS project
This repository is now in maintenance mode; meaning, new features will not be added but bug fixes will be released as detected.
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:
-
Clone the repository:
git clone https://github.com/nkss-dev/Project-Hyperlink.git
-
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
- using Command Prompt, run:
- Install the dependencies:
pip install -U -r requirements.txt
-
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.
-
For drive.py:
Follow the instructions given here and store the resultant.json
file in thedb
folder (generated automatically after the bot is run at least once) and rename it tocredentials.json
-
Run
python src/main.py