fixed userFile FileExistsError

This commit is contained in:
2025-08-19 15:36:37 -04:00
parent 05b05e6725
commit 18a95da9b1
2 changed files with 3 additions and 1 deletions

BIN
.gitignore vendored

Binary file not shown.

View File

@@ -16,6 +16,7 @@ import asyncio
import threading
userFile = Path('/config/users.json')
userFile.touch(exist_ok=True)
bot = interactions.Client(intents=interactions.Intents.DEFAULT,default_scope=2147491904)
@@ -24,6 +25,7 @@ try:
with open(userFile, 'x') as f:
print(f'users.json not found; saving to {userFile}')
except FileExistsError:
with open(userFile, 'r') as f:
authorized_users = json.load(f).get('authorized_users')
print(f'authorized_users:{authorized_users}')