better return system

This commit is contained in:
2024-09-03 18:37:48 +02:00
parent 6a0a399869
commit cf77c74c8f
2 changed files with 6 additions and 4 deletions
+4 -1
View File
@@ -29,7 +29,10 @@ class Aura:
self.r = redis.Redis(host=redis_host[0], port=int(redis_host[1]), username=REDIS_USER, password=REDIS_PSW, decode_responses=True)
def get(self, user_id) -> User | None:
return User(int(self.r.get(user_id)))
try:
return User(user_id, int(self.r.get(str(user_id))))
except:
return None
def add(self, user_id) -> User:
u = User(user_id, 100)