-
-
Notifications
You must be signed in to change notification settings - Fork 224
Installing Ballsdex without Docker
The recommended way to run Ballsdex is using Docker, but you may have reasons to run it without this dependency.
This install method is supported but only recommended for the advanced users, there are a lot of additional steps and dependencies to manage yourself.
Note
Few commands will be given, but online guides are given instead. This is because instructions differ between operating systems, so you have to use what's best for you.
Install PostgreSQL and start it. Create a database by following this guide.
You must then have a link to connect to the database in the following format: postgres://username:password@localhost:5432/database_name
Test that your database is up with the following command: psql -c "\l" postgres://username:password@localhost:5432/database_name
Check that your database appears in the list and that your user is the owner.
You must have the latest version of Python installed on your system. Given that it's new, it's unlikely that your system ships with the right Python version (check with python3.13 -V
).
On Linux/macOS, pyenv is a good tool for compiling any python version. You can also search instructions for your system to download pre-built binaries.
Check that you also have access to pip with python3.13 -m pip -V
You also need poetry, our package manager, to install the dependencies.
Run python3.13 -m pip install -U poetry
to install it.
Git is needed to download and update the source code.
You must first setup a Discord bot account. You can follow discord.py's tutorial to create and invite your bot.
For now, don't copy your token, but keep the page open.
Once this is configured, you also need to enable message content intent. Go to the "Bot" tab of your application, scroll down to "Privileged intents" and tick "Message content".
Tip
You can fill the description of your application, it will appear under the "About me" section.
Type the following command to download the latest version of the bot:
git clone https://github.com/laggron42/BallsDex-DiscordBot.git
Then you can use the command cd to change directory and open the folder you just downloaded:
cd BallsDex-DiscordBot
-
poetry install
to download and install the bot's dependencies. -
poetry shell
to open the virtual environment where your dependencies are -
python3 -m ballsdex --version
to check that the bot loads successfully -
python3 -m ballsdex --reset-settings
to create the default configuration file cd admin_panel
-
python3 manage.py migrate
to initialize the database -
python3 manage.py collectstatic --no-input
to initialize the admin panel -
cd ..
(return to the previous directory for the next steps)
Follow this section from the main tutorial to fill the base settings.
Before running the bot, you must tell it about your database. Export the BALLSDEXBOT_DB_URL
environment variable with the link to Postgres you tested earlier:
- Linux/macOS:
export BALLSDEXBOT_DB_URL=postgres://username:password@localhost:5432/database_name
- Windows:
$Env.BALLSDEXBOT_DB_URL = 'postgres://username:password@localhost:5432/database_name'
Then, run python3 -m ballsdex
to start the bot! To shut it down, type Ctrl+C.
Tip
There are multiple options available when running the bot, do python3 -m ballsdex -h
to view them.
- Open another shell with
poetry shell
enabled and the environment variables exported cd admin_panel && uvicorn admin_panel.asgi:application
- Follow this guide afterwards
Before running any command, do these:
-
cd BallsDex-DiscordBot
(open the bot's directory) -
poetry shell
(activate the virtual environment) export BALLSDEXBOT_DB_URL=postgres://username:password@localhost:5432/database_name
Then
- Start the bot:
python3 -m ballsdex
- Start the admin panel:
cd admin_panel && uvicorn admin_panel.asgi:application
git pull
-
poetry install
to update dependencies cd admin_panel
python3 manage.py migrate
python3 manage.py collectstatic --no-input
- Restart the bot and admin panel
Support my work on Patreon and get exclusive rewards!
For $7.50/month, I will be hosting your custom bot on my server, with immediate updates, and a secure and shared admin panel!