]> us-delaporte.pagekite.me Git - matrix-cadbury.git/commitdiff
Add DATA_DIR
authorEdward Delaporte <edward@delaporte.us>
Sat, 28 Mar 2026 01:37:14 +0000 (20:37 -0500)
committerEdward Delaporte <edward@delaporte.us>
Sat, 28 Mar 2026 01:37:14 +0000 (20:37 -0500)
README.md
app.py

index 1b48dfdbecfffbdc0f884b0c0214b9a600f8dba1..e0449eb573348e13408188a70cc221e4a836d280 100644 (file)
--- a/README.md
+++ b/README.md
@@ -13,6 +13,12 @@ the purpose of `Cadbury` is to compose several together under a single Matrix bo
 
 Create a bot account on your Matrix server, and set the necessary environment variables: `MATRIX_SERVER`, `MATRIX_BOT`, `MATRIX_BOT_PWD`.
 
 
 Create a bot account on your Matrix server, and set the necessary environment variables: `MATRIX_SERVER`, `MATRIX_BOT`, `MATRIX_BOT_PWD`.
 
+Set `MATRIX_DATA_DIR` to an existing directory path where you would like Cadbury to store any `sqlite3` databases.
+
+Expect files such as `goals.db` and `chores.db` to appear there after you tell Cadbury `!chore setup` and `!goal setup`, etc.
+
+Ensure that `python` and `sqlite3` are installed and available on the path.
+
 > Tip: Cadbury has no use for email. Your Matrix server may allow creating the bot account without an email account, using a `token` registration type.
 
 Run the bot with `make serve`,
 > Tip: Cadbury has no use for email. Your Matrix server may allow creating the bot account without an email account, using a `token` registration type.
 
 Run the bot with `make serve`,
@@ -27,6 +33,16 @@ Then use the following command to launch the bot:
 
        .venv/bin/python app.py
 
 
        .venv/bin/python app.py
 
+## Chatting
+
+Invite you Cadbury bot to a Matrix channel, and it will accept automatically, if it can.
+
+> Tip: Additional setup is required to add a Matrix bot to an encrypted channel.
+
+Use `!goal help` and `!chore help`, to get started.
+
+> Tip: Many bot roles require creating a sqlite3 database, and may require you to tell Cadbuary something like `!chore setup` one initial time to create the database file.
+
 ## Remixing
 
 When creating your own unique mix of bot roles, consider creating a public fork of
 ## Remixing
 
 When creating your own unique mix of bot roles, consider creating a public fork of
diff --git a/app.py b/app.py
index 3b802074c010e946a5fdd05cbb115688329a15ca..01fdc2e47f4cc574aed7b61fa1f62725874cfbdf 100644 (file)
--- a/app.py
+++ b/app.py
@@ -8,6 +8,7 @@ from matrix_chore_bot.bot import chore_bot
 SERVER = os.environ.get('MATRIX_SERVER')
 BOT_NAME = os.environ.get('MATRIX_BOT')
 BOT_PWD = os.environ.get('MATRIX_BOT_PWD')
 SERVER = os.environ.get('MATRIX_SERVER')
 BOT_NAME = os.environ.get('MATRIX_BOT')
 BOT_PWD = os.environ.get('MATRIX_BOT_PWD')
+DATA_DIR = os.environ.get('MATRIX_DATA_DIR')
 
 creds = botlib.Creds(SERVER, BOT_NAME, BOT_PWD)
 bot = botlib.Bot(creds)
 
 creds = botlib.Creds(SERVER, BOT_NAME, BOT_PWD)
 bot = botlib.Bot(creds)
@@ -15,12 +16,12 @@ bot = botlib.Bot(creds)
 
 @bot.listener.on_message_event
 async def do_goal_stuff(room, message):
 
 @bot.listener.on_message_event
 async def do_goal_stuff(room, message):
-    await goal_bot(room, message, bot)
+    await goal_bot(room, message, bot, DATA_DIR)
 
 
 @bot.listener.on_message_event
 async def do_chore_stuff(room, message):
 
 
 @bot.listener.on_message_event
 async def do_chore_stuff(room, message):
-    await chore_bot(room, message, bot)
+    await chore_bot(room, message, bot, DATA_DIR)
 
 
 bot.run()
 
 
 bot.run()