fix wording, add config

This commit is contained in:
Lili (Tlapka) 2022-09-12 09:43:51 +02:00
parent 496b168677
commit 55ab9c774a
1 changed files with 16 additions and 7 deletions

View File

@ -38,7 +38,7 @@ Create a `tlapbot/config.py` file and fill it in as needed.
Default values are included in `tlapbot/default_config`, and values in Default values are included in `tlapbot/default_config`, and values in
`config.py` overwrite them. `config.py` overwrite them.
Some recommendations: Tlapbot will probably not work if you don't overwrite these:
```bash ```bash
SECRET_KEY # get one from running `python -c 'import secrets; print(secrets.token_hex())'` SECRET_KEY # get one from running `python -c 'import secrets; print(secrets.token_hex())'`
OWNCAST_ACCESS_TOKEN # get one from owncast instance OWNCAST_ACCESS_TOKEN # get one from owncast instance
@ -52,7 +52,7 @@ In Access Tokens, generate an Access Token to put in
`tlapbot/config.py`. At the moment, the only permission the Access Token needs `tlapbot/config.py`. At the moment, the only permission the Access Token needs
is sending messages, the bot doesn't perform any administrative actions. is sending messages, the bot doesn't perform any administrative actions.
#### Webhook #### Webhook
In webhooks, you create a Webhook, and point it at your bot's URL with In webhooks, create a Webhook, and point it at your bot's URL with
`/owncastWebhook` added. `/owncastWebhook` added.
In debug, this will be something like `localhost:5000/owncastWebhook`, In debug, this will be something like `localhost:5000/owncastWebhook`,
@ -60,16 +60,16 @@ or, if you're not running the debug Owncast instance and bot on the same machine
you can use a tool like [ngrok](https://ngrok.com/) you can use a tool like [ngrok](https://ngrok.com/)
to redirect the Owncast traffic to your `localhost`. to redirect the Owncast traffic to your `localhost`.
#### External Action #### External Action
In External Actions, you point the external action to your bot's URL with `/dashboard` added. In External Actions, point the external action to your bot's URL with `/dashboard` added.
In debug, this might be something like `localhost:5000/dashboard`, In debug, this might be something like `localhost:5000/dashboard`,
or you can use a tool like ngrok again. or you can use a tool like ngrok again.
Example: **Example:**
```
URL: MyTlapbotServer.com/dashboard URL: MyTlapbotServer.com/dashboard
Action Title: Redeems Dashboard Action Title: Redeems Dashboard
```
### Running in debug: ### Running in debug:
Set the FLASK_APP variable: Set the FLASK_APP variable:
@ -86,3 +86,12 @@ python -m flask --debug run
``` ```
### Running in prod: ### Running in prod:
To be added when I actually run a prod version of the bot. To be added when I actually run a prod version of the bot.
## Config
Values you can include in `tlapbot/config.py` to change how the bot behaves.
### Channel points interval and amount
`POINTS_CYCLE_TIME` decides how often channel points are given to users in chat,
in seconds.
`POINTS_AMOUNT_GIVEN` decides how many channel points users receive.
By default, everyone receives 10 points every 600 seconds (10 minutes).