diff options
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: |
