Вот ошибка:
File "E:\Python (files)\Bots\tgbot\Dragon\tg_bot.py", line 462, in balance
if cursor.execute("SELECT cash FROM users WHERE id = {}".format(ctx.author.id)).fetchone()[0] != None:
TypeError: 'NoneType' object is not subscriptable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Python\Python38\lib\site-packages\discord\ext\commands\bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "C:\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 462, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'NoneType' object is not subscriptable
@client.command(pass_context = True)
async def balance(ctx, member: discord.Member = None):
if member is None:
if cursor.execute("SELECT cash FROM users WHERE id = {}".format(ctx.author.id)).fetchone()[0] != None:
await ctx.send(embed = discord.Embed(
description = f"""Баланс пользователя **{ctx.author.mention}** составляет **{cursor.execute('SELECT cash FROM users WHERE id = {}'.format(ctx.author.id)).fetchone()[0]}:dollar:**""",
color = 0x2ecc71))
else:
await ctx.send(embed = discord.Embed(
description = f"""Баланс пользователя **{ctx.author.mention}** составляет **{cursor.execute("SELECT cash FROM users WHERE id = {}".format(ctx.author.id)).fetchone()[0]}:dollar:**""",
color = 0x2ecc71))
else:
await ctx.send(embed = discord.Embed(
description = f"""Баланс пользователя **{member.mention}** составляет **{cursor.execute("SELECT cash FROM users WHERE id = {}".format(member.id)).fetchone()[0]}:dollar:**""",
color = 0x2ecc71))
Что делать?