Экономика в discord.py ошибка магазина
Я писал экономику в discord.py, и у меня вышла ошибка при призыве магазина:
[2022-08-23 12:07:50] [ERROR ] discord.ext.commands.bot: Ignoring exception in command Магазин Traceback (most recent call last): File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 200, in wrapped ret = await coro(*args, **kwargs) File "E:\Projects\Kefir\Python\Economy.py", line 126, in __shop for row in cursor.execute("SELECT role_id, cost FROM shop WHERE id = {}".format(ctx.guild.id)): sqlite3.OperationalError: no such column: cost The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 1330, in invoke await ctx.command.invoke(ctx) File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 995, in invoke await injected(*ctx.args, **ctx.kwargs) # type: ignore File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 209, in wrapped raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OperationalError: no such column: cost
Вот код:
@client.command(name = "Магазин")
async def __shop(ctx):
embed = discord.Embed(title = "Магазин")
for row in cursor.execute("SELECT role_id, cost FROM shop WHERE id = {}".format(ctx.guild.id)):
if ctx.guild.get_role(row[0]) != None:
embed.add_field(
name = f"Стоимость **{row[1]}** <:Ban:990705130720591872>",
value = f"Вы приобретете роль {ctx.guild.get_role(row[0]).mention}",
inline = False
)
else:
pass
await ctx.send (embed = embed)
А также код создания таблицы для магазина:
cursor.execute("""CREATE TABLE IF NOT EXISTS shop (
role_id INT,
id INT,
cost BIGINT
)""")
Заранее спасибо!