main: load lab_cleaning_signal_base_group from config

This commit is contained in:
lemoer 2024-12-28 14:03:00 +01:00
parent 7eb5d71e4e
commit 9539ec5984
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,5 @@
{ {
"apiurl": "http://localhost:8080", "apiurl": "http://localhost:8080",
"number": "+4900000000001" "number": "+4900000000001",
"lab_cleaning_signal_base_group": "group.00000000000000000000000000000000000000000000000000000000000="
} }

View File

@ -17,6 +17,7 @@ from sqlmodel import Session, SQLModel, create_engine, select
class Config(BaseModel): class Config(BaseModel):
apiurl: str apiurl: str
number: str number: str
lab_cleaning_signal_base_group: str
def signal_timestamp_to_datetime(timestamp: str) -> datetime.datetime: def signal_timestamp_to_datetime(timestamp: str) -> datetime.datetime:
return datetime.datetime.fromtimestamp(int(timestamp)/1000) 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): async def main(config: Config, session: Session):
api = SignalAPI(config.apiurl, config.number) api = SignalAPI(config.apiurl, config.number)
bot = LabCleaningBot(api, "group.bm5KT3NJUW5FdkpRNnR2ZGRFa01oOVZBeUYrVkdnd3NNTzFpNWdsR2pwUT0=") bot = LabCleaningBot(api, config.lab_cleaning_signal_base_group)
await asyncio.gather( await asyncio.gather(
bot.receiver(session), bot.receiver(session),