From 9539ec59841395eec555e49caf25189a5b47f345 Mon Sep 17 00:00:00 2001 From: lemoer Date: Sat, 28 Dec 2024 14:03:00 +0100 Subject: [PATCH] main: load lab_cleaning_signal_base_group from config --- config.json.example | 3 ++- main.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config.json.example b/config.json.example index f41fc53..416e21b 100644 --- a/config.json.example +++ b/config.json.example @@ -1,4 +1,5 @@ { "apiurl": "http://localhost:8080", - "number": "+4900000000001" + "number": "+4900000000001", + "lab_cleaning_signal_base_group": "group.00000000000000000000000000000000000000000000000000000000000=" } diff --git a/main.py b/main.py index c484df4..5cf97e4 100644 --- a/main.py +++ b/main.py @@ -17,6 +17,7 @@ from sqlmodel import Session, SQLModel, create_engine, select class Config(BaseModel): apiurl: str number: str + lab_cleaning_signal_base_group: str def signal_timestamp_to_datetime(timestamp: str) -> datetime.datetime: return datetime.datetime.fromtimestamp(int(timestamp)/1000) @@ -503,7 +504,7 @@ You have time to answer for {format_seconds(task.timeout)}.""" async def main(config: Config, session: Session): api = SignalAPI(config.apiurl, config.number) - bot = LabCleaningBot(api, "group.bm5KT3NJUW5FdkpRNnR2ZGRFa01oOVZBeUYrVkdnd3NNTzFpNWdsR2pwUT0=") + bot = LabCleaningBot(api, config.lab_cleaning_signal_base_group) await asyncio.gather( bot.receiver(session),