I will go directly to the point; I'm having problems with accessing values in my Repl.it Database. I made an entire class in another file to access the database, I'm able to print out and return values but can't add values to a list in the database.
Here is my function (inside of a class) to add VIP members(discord) to the database:
def add_vip(self, db_name, user_id):
if db_name in db:
# Check if user not already in DB
if user_id not in db[db_name]["users_id"]:
db[db_name]["users_id"].append(user_id)
# Verify if user was added
return (True, "User added!", db[db_name]["users_id"], type(db[db_name]["users_id"]))
else:
return (False, "User already exists!", "Error")
else:
return (False, "Db does not exist or lengh of user_id below 18 digits!", "Error"
The actual problem: It prints out the debugging return, and it prints out "True, "User added" and all that etc.. but it does not actually add it to the list inside of that key."
I feel like this may be a really dumb mistake that I just can't identify... Anyways I'm seeking the gods of Stackoverflow for this, thank you.
If you need more code just lmk and I'll send it!
This does not give me any errors That's why I did not post it here!