Contributing to Sokora¶
Status
Whole page reflects both branches.
Prerequisites¶
- Basic knowledge of TypeScript and discord.js.
- Bun installed.
- Either
AorB:A- PostgreSQL installed.
- Port 5432 on your machine free, Sokora needs it.
B- Docker installed.
Get started with contributing¶
Getting the code¶
- Make a fork of this repository.
- Clone your fork.
Creating your bot¶
- Head over to the Discord Developer Portal and make a new application.
- Invite your bot to your server.
- You need to enable bot installation. Go to the “Installation” tab, add the
botoption, set the appropriate permissions (since it’s a testing bot,Administratorwill do) then open the provided link to add it to a server of your choice. Don’t use the user install.
- You need to enable bot installation. Go to the “Installation” tab, add the
- From the “Bot” tab, reset and then copy your bot’s token.
Setting Sokora up¶
- Run the setup utility with
bun run setupand our CLI tool will install dependencies and write .env for you. It’ll ask for things like user token, control channel IDs, and whether you're using Docker for development or not.
We assume you’re using Docker, as it is our recommended way of developing.
If you’re NOT doing that, then refer to the next section, and note there are prior steps to running the setup utility.
Manual setup for not using Docker¶
If you prefer to run Sokora without going through a container, you must setup PostgreSQL locally before running the setup utility.
PostgreSQL¶
- Check if you already have PostgreSQL installed on your machine. If not, refer to your platform’s package manager or get it from postgresql.org.
- If you’re on Windows, proceed with the set up, remember your port (or keep it as
5432) as it will be used later on. - Launch
sudo -u postgre psql(or SQL Shell in the start menu of Windows, you’d have to log into the postgre account). - Create a new user with this command:
CREATE USER name CREATEDB PASSWORD ’pass’;, whereCREATEDBgives the user the permission to create new databases andPASSWORDlets the bot connect to the database.- Absent semicolons cause it to silently fail. Make sure to type them.
- Check if the user has been created by typing
\duafterwards.
- Create a database like so:
CREATE DATABASE dbname OWNER ’name’;- Check if the database has been created by quitting the default database with
\qand launchingpsql -U name -d dbnamewherenameanddbnameare the same names you provided before.
- Check if the database has been created by quitting the default database with
Going back to the setup utility¶
Tell it you won't use Docker, then provide:
- The user you created (
name). - The database name (
dbname). - The password you created (
pass). - The host (leave empty unless you know it’s not
localhostfor some reason, which it should be set to by default). - The port (check what it is by running
psql -U name -d dbname -c "SHOW port;").
Running¶
If running on your local hardware, just run bun dev.
If you prefer to run the Docker container, run docker compose up --build --watch. Or just ./run.sh if on macOS/Linux.
Basic repository guidelines¶
Commit guidelines¶
We require all commits to strictly follow a very specific commit convention we've made.
Please refer to the Subete commit guidelines.
Change merging guidelines¶
Be sure to open a pull request when you’re ready to push your changes. If you happen to have write access to our repo, remember to:

Keep the description as short as you can, but not shorter. Pull requests should explain in detail WHAT they do and WHY. The “how” is usually irrelevant, your code should be self-explanatory (if it’s not, then it’s likely wrong).
If a pull request is large in scope OR if it contains “redundant” commits (such as to fix linter issues with the PR), it should be squashed into a single commit upon merge.