2025-01-31 14:31:30 -06:00
|
|
|
# quotes-bot-python
|
|
|
|
|
2025-01-31 18:47:36 -06:00
|
|
|
WIP rewrite of n/quotes-bot in Python with https://codeberg.org/imbev/simplematrixbotlib.
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
First, make and activate a venv. There are plenty of guides online, however it usually goes like this:
|
|
|
|
```sh
|
|
|
|
python3 -m virtualenv venv && source venv/bin/activate.fish
|
|
|
|
```
|
|
|
|
If you use bash, you can replace `source venv/bin/activate.fish` with just `source venv/bin/activate`.
|
|
|
|
|
|
|
|
#### Dependencies
|
|
|
|
|
2025-01-31 19:07:25 -06:00
|
|
|
This bot depends on `simplematrixbotlib` and `requests`, which can be installed in your venv like this:
|
2025-01-31 18:47:36 -06:00
|
|
|
```sh
|
2025-01-31 19:07:25 -06:00
|
|
|
pip install simplematrixbotlib requests
|
2025-01-31 18:47:36 -06:00
|
|
|
```
|
|
|
|
|
|
|
|
#### Configuring
|
|
|
|
|
|
|
|
> TODO: write docs about the config file
|
|
|
|
|
|
|
|
First, copy the sample config:
|
|
|
|
```sh
|
|
|
|
cp config.sample.json config.json
|
|
|
|
```
|
|
|
|
Then edit it:
|
|
|
|
```sh
|
|
|
|
$EDITOR config.json
|
|
|
|
```
|
|
|
|
You should be good to go! To run it, run this in the venv:
|
|
|
|
```sh
|
|
|
|
python bot.py
|
|
|
|
```
|