Let me explain:
if config == "create":
if str(user.id) in submissions:
await ctx.send(embed=discord.Embed(title="ERROR", description='you already have a submission!', color=discord.Color.red()))
return
if len(submission_full) > 2 and len(submission_full) < 100:
submissions[str(user.id)] = {}
submissions[str(user.id)]["submission"] = submission_full
Basically what I have here is a discordpy submission command that creates a submission and dumps it into a json file. I am currently working on a command that does the same thing but reversed, so it deletes your submission if you want to undo.
My first thought was doing this:
if config.lower() in ["delete","remove","undo","cancel"]:
await ctx.send(embed=discord.Embed(title="Removing Current Submission..", description="You will no longer have any submissions. You can create a new one at any time!", color=0xFFD700))
submissions[str(user.id)] = None
But it simply replaces your submission with "null".
Here is the output in the json file:
{"710826704259645450": null}
Help appreciated!
>Solution :
You want:
del submissions[str(user.id)]