Я пытаюсь создать странный счетчик картофеля с помощью discord.py и сохранить его в файл. json.
Код ниже:
@client.command()
async def get(ctx):
with open('get.json', 'r') as f:
get = json.load(f)
get[str(ctx.author.id)] = bal + 1
with open('get.json', 'w') as f:
json.dump(get, f, indent=4)
await ctx.send('You got 1 potato!')
, но он дает мне эта ошибка:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: unsupported operand type(s) for +: 'function' and 'int'