Commit graph

16 commits

Author SHA1 Message Date
52d619377e bot: types: add types package
This package collects all kinds of useful type definitions that will
aid me in development.

Some things could be expanded in the future when they become necessary
(e.g. poll result embeds), but for now this should be enough.

Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-14 00:12:09 +01:00
8ffe964386 bot: main: fix commands not being processed
Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-14 00:11:41 +01:00
18f057793e bot: main: fix root logger not being initialised correctly
tl;dr: shouldn't have passed __name__ to logging.getLogger()

This also makes it so that discord.py is logging everything as
expected, which it didn't do before.

Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-14 00:10:05 +01:00
1dfa03bc17 bot: db: add missing type annotation for bulk_update
All checks were successful
/ test (push) Successful in 18s
Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-11 22:57:33 +01:00
80918f7a42 bot: main: register event handlers inside separate function
Makes the overall program flow nicer.

Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-11 22:33:52 +01:00
14be2289a9 bot: main: fix description not being split
Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-11 22:33:26 +01:00
663abf56bc main: set up basic bot without commands
All checks were successful
/ test (push) Successful in 19s
As the summary says, this sets up a basic bot that doesn't listen to
any commands yet; the bot just runs and does nothing.

Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-10 23:58:21 +01:00
ba829254d8 pyproject: add discord.py as dependency
... and also update uv.lock.

Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-10 23:56:08 +01:00
1d571fc726 bot: db: add base model and a simple db manager
The base model basically just adds typing to peewee (lmao) and also
handles the date_created, date_updated fields all methods, except for
raw SQL.

This should make it a little easier to write a tiny async layer on top
of it all.

Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-10 23:56:08 +01:00
c2bd8de5fb readme: document known env vars
Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-10 23:34:00 +01:00
b2af736ae0 bot: env: map known env vars to object
This just makes accessing them easier.

What could be done in the future have some kind of utility method for
debugging that prints all of them or returns all of them as a dict or
something.

Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-10 23:31:41 +01:00
fee37c2372 workflows: add workflow for running tests
All checks were successful
/ test (push) Successful in 7s
This uses the python:3.13 docker image and also installs uv
beforehand. Checkout is performed "manually" because the standard
actions/checkout@v4 action requires node:20 as container, which is
annoying. I don't want to pull in node just to clone a git repo.

Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-06 02:37:26 +01:00
15e01aae8c tests: add basic test
in order to see whether pytest runs.

It in fact does: `uv run pytest`

Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-06 01:32:47 +01:00
588f8d065e setup basic project structure
... without any other dependencies except the rudimentary things, for
the time being.

This builds using `uv build` and can be run via `uv run bot`.

The bot can also be installed via `uv pip install .` (from the project
root) and then be imported via `import bot`.

Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-06 01:19:10 +01:00
74e46990de update .gitignore
Signed-off-by: Max R. Carrara <max@aequito.sh>
2025-03-06 01:06:28 +01:00
a0d87a1781 Initial commit 2025-03-06 00:22:04 +01:00