title: Discord.py- Economy system
body: <p>My code:</p>
  <pre><code>@client.command()
  async def balance(ctx):
    await open_account(ctx.author)
  
    user = ctx.author
  
    users = await get_bank_data()
    
    wallet_amt= users[str(user.id)][&quot;Wallet&quot;]
    bank_amt= users[str(user.id)][&quot;Bank&quot;]
  
  
    em = discord.Embed(title=f&quot;{ctx.author.name}'s balance.&quot;, color=discord.Color.teal()) 
    em.add_field(
      name=&quot;Wallet Balance&quot;,value=wallet_amt
    )
    em.add_field(
      name=&quot;Bank Balance&quot;,value=bank_amt
    )
    await ctx.send(embed=em)
  
  async def open_account(user):
    users = await get_bank_data()
    
    if str(user.id) in users:
      return False
    else:
      users[str(user.id)] = {}
      users[str(user.id)][&quot;Wallet&quot;] = 0
      users[str(user.id)][&quot;Bank&quot;] = 0
    
    with open(&quot;bank.json&quot;,'w') as f:
      users = json.dump(users,f)
    return True
  
  async def get_bank_data():
    with open(&quot;bank.json&quot;,'r') as f:
      users = json.load(f)
    return users
  
  @client.command()
  async def beg(ctx):
    await open_account(ctx.author)
  
    user = ctx.author
  
  
    users = await get_bank_data()
  
    earnings = random.randrange(101)
    await ctx.send(f&quot;Someone gave your {earnings} coins&quot;)
  
    users[str(user.id)][&quot;Wallet&quot;] += earnings
  
    with open(&quot;bank.json&quot;,'r') as f:
      users = json.dump(users,f)
  </code></pre>
  <p>Error:</p>
  <pre><code>discord.ext.commands.errors.CommandInvokeError: Command raised an exception: JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  </code></pre>
  <p>So I was making an economy system for my discord bot, and faced this error. I dont really know how to fix this, and doing stuff only leads to more errors. It would be cool if someone could correct, and probably explain where i went wrong.</p>