Возникла ошибка при переходе с SQLlite на PostgresQl.
Выводит ошибку:
TypeError: 'NoneType' object is not iterable
Вот код:
@commands.command(pass_context=True, aliases=['shop','магазин'])
async def __shop(self, ctx):
embed = discord.Embed(title="Магазин ролей",color=0x00d166)
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"Роль ``{ctx.guild.get_role(row[0])}``",
value = f"Стоимость роли: {row[1]} :leaves:",
inline = False
)
await ctx.send(embed = embed)
Трейс ошибки полностью:
Ignoring exception in command __shop:
Traceback (most recent call last):
File "D:\DirectoryStorm\Miku\venv\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "D:\DirectoryStorm\Miku\bot\cogs\Statistics.py", line 134, in __shop
for row in cursor.execute("SELECT role_id, cost FROM shop WHERE id = {}".format(ctx.guild.id)):
TypeError: 'NoneType' object is not iterable
The above exception was the direct cause of the following exception: