From d6792c91a85b677ee8e38f55ae815d9985dd79ba Mon Sep 17 00:00:00 2001 From: Finn Christiansen Date: Fri, 14 Jun 2024 21:25:46 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20Make=20session=20persistent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose.yml | 2 ++ data/.gitignore | 4 ++++ matrix_bot_praying_times/__main__.py | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 data/.gitignore diff --git a/compose.yml b/compose.yml index 13cfccf..e2e4fbb 100644 --- a/compose.yml +++ b/compose.yml @@ -8,3 +8,5 @@ services: - BOT_HOMESERVER - BOT_USERNAME - BOT_PASSWORD + volumes: + - ./data/:/bot/data diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/matrix_bot_praying_times/__main__.py b/matrix_bot_praying_times/__main__.py index ac63ed2..c39d3ef 100644 --- a/matrix_bot_praying_times/__main__.py +++ b/matrix_bot_praying_times/__main__.py @@ -12,7 +12,8 @@ load_dotenv() creds = botlib.Creds( os.getenv("BOT_HOMESERVER"), os.getenv("BOT_USERNAME"), - os.getenv("BOT_PASSWORD") + os.getenv("BOT_PASSWORD"), + session_stored_file="data/session.txt" ) bot = botlib.Bot(creds)