A simple cookiecutter template for a discord.py-postgres bot. Comes with some basic utility commands prepared.
pip install cookiecutter pipenv
cookiecutter https://github.com/makupi/cookiecutter-discord.py-postgres
pipenv
to manage your virtual environmentconfig.json
file with token and prefix.gitignore
with python template andconfig.json
already ignored- basic utility cog with
ping
,info
etc. gino
as a postgresql ORMalembic
for database migrationsdocker
anddocker-compose
for easier deployment (and development)
You can either set up postgresql yourself and put the URI in config.json
or run the database with docker-compose
To start only the database with docker-compose:
docker-compose up -d db
Then you have to generate an initial revision with alembic:
pipenv install
pipenv shell
alembic revision --autogenerate -m "Initial Revision"
And apply the revision with
alembic upgrade head
Whenever you make changes to your models you will have to generate a new revision and apply it.
pipenv install
pipenv shell
python run.py
Parts of my template are inspired by discord-bot-cli
made by StroupBSlayen.