Answer the question
In order to leave comments, you need to log in
TypeError: '>' not supported between instances of 'str' and 'int', what should I do?
@bot.command(pass_context = True)
async def Test(ctx):
if 'coins' > 15500:
coins = users[str(user.id)]['coins']
with open('users.json', 'r') as f:
users = json.load(f)
await add_coins(users, message.author, 50000)
with open('users.json','w') as f:
json.dump(users, f)
async def add_coins(users, user, coin):
users[str(user.id)]['coins'] += coin
Traceback (most recent call last):
File "C:\Users\stas\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\bot.py", line 892, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\stas\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 797, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\stas\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 92, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: '>' not supported between instances of 'str' and 'int'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question