Server Utilities is a custom Discord bot for Orleans and Varien's Homework Folder. It provides message moderation, reaction roles, a starboard, bot status commands, and an experimental verification workflow.
-
Install Python 3.11 or newer.
-
Create and activate a virtual environment.
-
Install dependencies:
python -m pip install -r requirements.txt
-
Copy
.env.exampleto.envand setDISCORD_TOKENandDATABASE_URL. -
Enable the Server Members Intent and Message Content Intent for the bot in the Discord Developer Portal.
-
Run the bot:
python server_utilities.py
The bot stores its persistent data in Postgres. A Neon Postgres database is
recommended; keep its connection string in DATABASE_URL. Server, role, and
channel IDs are currently configured in the Python modules.
This is a persistent Discord Gateway bot and must run as a continuously running worker. It is not compatible with a Vercel Function as the primary bot process.
- Create a Neon Postgres project and copy its connection string.
- Create a Render Background Worker from this repository.
- Use the included
render.yaml, or set the build command topip install -r requirements.txtand the start command topython -m scripts.migrate_legacy && python server_utilities.py. - Add
DISCORD_TOKENandDATABASE_URLas secret environment variables.
The legacy message_ids.txt entries are imported idempotently before the bot
starts. The file is no longer read by normal event handling.
DATABASE_URL is not a path to a local file. It is the Postgres connection
string supplied by Neon, for example:
postgresql://user:password@host/database?sslmode=require
After creating the Neon database and setting DATABASE_URL in your local .env,
run this once from the repository:
python -m scripts.migrate_legacy --sqlite-path "C:\Users\Stacer Varien\Documents\database.db"The current blacklist, starboard, and verification data are imported into the
active tables. Older unused SQLite tables are retained in legacy_sqlite_rows
so their data is preserved without affecting the current bot.
The offline checks do not connect to Discord or require a token:
python -m unittest discover -v
python -m compileall -q .This project is licensed under the MIT License with the Commons Clause License Condition. See LICENSE and COMMON CLAUSE.