@Shonnix

Из-за чего вылезает ошибка unrecognized token: «{»?

async def balance(ctx, member: discord.Member = None):
    if member is None:
        await ctx.send(embed = discord.Embed(
            description = f"""Баланс пользователя **{ctx.author}** состовляет **{cursor.execute("SELECT cash FROM users WHERE id = {}").fetchone()[0]} :leaves: **"""))

    else:
        await ctx.send(embed=discord.Embed(
            description= f"""Баланс пользователя **{member}** состовляет **{cursor.execute("SELECT cash FROM users WHERE id = {}").fetchone()[0]} :leaves:**"""))


Сама ошибка:
Ignoring exception in command balance:
Traceback (most recent call last):
File "/home/rkksol/PycharmProjects/pythonProject/venv/lib/python3.6/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "/home/rkksol/PycharmProjects/pythonProject/bot.py", line 52, in balance
description = f"""Баланс пользователя **{ctx.author}** состовляет **{cursor.execute("SELECT cash FROM users WHERE id = {}").fetchone()[0]} :leaves: **"""))
sqlite3.OperationalError: unrecognized token: "{"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/rkksol/PycharmProjects/pythonProject/venv/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/home/rkksol/PycharmProjects/pythonProject/venv/lib/python3.6/site-packages/discord/ext/commands/core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/rkksol/PycharmProjects/pythonProject/venv/lib/python3.6/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OperationalError: unrecognized token: "{"
  • Вопрос задан
  • 222 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы