diff options
| author | salmonik <raisersoft@proton.me> | 2026-02-20 18:35:36 +0100 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-02-20 18:35:36 +0100 |
| commit | 1017fb648b1114106abe596663d26aa23fe12805 (patch) | |
| tree | 7f56e2b0aac9d19714985bf835aa7d1f90cf4428 /main.py | |
| parent | more asynchronous work and other minor improvements (diff) | |
| download | senator-sperma-1017fb648b1114106abe596663d26aa23fe12805.tar.gz senator-sperma-1017fb648b1114106abe596663d26aa23fe12805.zip | |
fix settings file nagging
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -46,7 +46,8 @@ async def on_ready(): | |||
| 46 | if os.path.exists(settings): | 46 | if os.path.exists(settings): |
| 47 | try: | 47 | try: |
| 48 | async with aiofiles.open(settings) as f: | 48 | async with aiofiles.open(settings) as f: |
| 49 | data = json.load(f) | 49 | content = await f.read() |
| 50 | data = json.loads(content) | ||
| 50 | assert 'volume' in data and isinstance(data['volume'], float) | 51 | assert 'volume' in data and isinstance(data['volume'], float) |
| 51 | assert 'audio_paths' in data and isinstance(data['audio_paths'], list) | 52 | assert 'audio_paths' in data and isinstance(data['audio_paths'], list) |
| 52 | except (json.JSONDecodeError, AssertionError) as error: | 53 | except (json.JSONDecodeError, AssertionError) as error: |
