Skip to content
Advertisement

Cannot add/append element to JSON File

So, I was making a discord bot for an RP server with 4k members in emergency. My goal was to store the lawyers database in a json file that would be hosted on one of my computers for testing. Here is my code:

JavaScript

Here is the Compiler Error (Python 3.9):

JavaScript

I tried to look at other posts to see if there was a solution. But it was a post from 2015 which didn’t solve my problem.

My goal here was to append details about the Discord User who entered the info and has entered my command to register.

Thank you for reading this post

Advertisement

Answer

JavaScript

You’re using the result of json.dump() as the argument to json.load().

But json.dump() doesn’t return anything. So you’re effectively calling json.load(None).

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement