move defaults to defaults folder

This commit is contained in:
Lili (Tlapka) 2025-03-10 19:52:55 +01:00
parent d0ff884dec
commit 9592e2daf0
6 changed files with 6 additions and 6 deletions

View File

@ -122,7 +122,7 @@ as a package in editable more.
python -m flask init-db python -m flask init-db
``` ```
5. Create an `instance/config.py` file and fill it in as needed. 5. Create an `instance/config.py` file and fill it in as needed.
Default values are included in `tlapbot/default_config.py`, and values in Default values are included in `tlapbot/defaults/default_config.py`, and values in
`config.py` overwrite them. (The database also lives in the instance folder `config.py` overwrite them. (The database also lives in the instance folder
by default.) by default.)
@ -133,7 +133,7 @@ by default.)
OWNCAST_INSTANCE_URL # default points to localhost owncast on default port OWNCAST_INSTANCE_URL # default points to localhost owncast on default port
``` ```
6. OPTIONAL: Create an `instance/redeems.py` file and add your custom redeems. 6. OPTIONAL: Create an `instance/redeems.py` file and add your custom redeems.
If you don't add a redeems file, the bot will initialize the default redeems from `tlapbot/default_redeems.py`. If you don't add a redeems file, the bot will initialize the default redeems from `tlapbot/defaults/default_redeems.py`.
More details on how to write the config and redeems files are written later in the readme. More details on how to write the config and redeems files are written later in the readme.
7. If you've added any new counters or milestones, run `refresh-counters` or `refresh-milestones` commands to initialize them into the database. 7. If you've added any new counters or milestones, run `refresh-counters` or `refresh-milestones` commands to initialize them into the database.
@ -299,7 +299,7 @@ Including these values is mandatory if you want tlapbot to work.
- `OWNCAST_ACCESS_TOKEN` is the owncast access token that owncast will use to get list of users in chat. Generate one in your owncast instance. - `OWNCAST_ACCESS_TOKEN` is the owncast access token that owncast will use to get list of users in chat. Generate one in your owncast instance.
- `OWNCAST_INSTANCE_URL` is the full URL of your owncast instance, like `"http://MyTlapbotServer.example"` - `OWNCAST_INSTANCE_URL` is the full URL of your owncast instance, like `"http://MyTlapbotServer.example"`
#### Optional #### Optional
Including these values will overwrite their defaults from `/tlapbot/default_config.py`. Including these values will overwrite their defaults from `/tlapbot/defaults/default_config.py`.
- `POINTS_CYCLE_TIME` decides how often channel points are given to users in chat, - `POINTS_CYCLE_TIME` decides how often channel points are given to users in chat,
in seconds. in seconds.
- `POINTS_AMOUNT_GIVEN` decides how many channel points users receive. - `POINTS_AMOUNT_GIVEN` decides how many channel points users receive.
@ -320,7 +320,7 @@ LIST_REDEEMS=True
ACTIVE_CATEGORIES=["gaming"] ACTIVE_CATEGORIES=["gaming"]
``` ```
### redeems.py ### redeems.py
`redeems.py` is a file where you define all your custom redeems. Tlapbot will work without it, but it will load a few default, generic redeems from `tlapbot/default_redeems.py`. `redeems.py` is a file where you define all your custom redeems. Tlapbot will work without it, but it will load a few default, generic redeems from `tlapbot/defaults/default_redeems.py`.
(`redeems.py` should be in the instance folder: `instance/redeems.py` for folder install.) (`redeems.py` should be in the instance folder: `instance/redeems.py` for folder install.)
#### `default_redeems.py`: #### `default_redeems.py`:

View File

@ -20,8 +20,8 @@ def create_app(test_config: None = None) -> Flask:
app.config.from_mapping( app.config.from_mapping(
DATABASE=os.path.join(app.instance_path, "tlapbot.sqlite") DATABASE=os.path.join(app.instance_path, "tlapbot.sqlite")
) )
app.config.from_object('tlapbot.default_config') app.config.from_object('tlapbot.defaults.default_config')
app.config.from_object('tlapbot.default_redeems') app.config.from_object('tlapbot.defaults.default_redeems')
app.config.from_pyfile('config.py', silent=True) app.config.from_pyfile('config.py', silent=True)
app.config.from_pyfile('redeems.py', silent=True) app.config.from_pyfile('redeems.py', silent=True)

View File

View File