Не могу понять, в чем ошибка. Помогите пожалуйста.
Ошибка:
SyntaxError: invalid syntax
Ошибка в строке
elif warns + 1 >= cursor.fetchone()[0]:
Вот код функции:
@commands.command()
@commands.has_permission(kick_members=True, ban_members=True)
async def warn(self, ctx, member: discord.abc.User, *reason):
member = ctx.guild.get_member(member.id)
cursor.execute(f"SELECT warns FROM guild_users_{ctx.guild.id} WHERE id = {member.id}")
warns = cursor.fetchone()[0]
if reason==[]:
txt('moderation.warn.no_reason', [], ctx)
if ctx.author==member:
await ctx.send(txt('moderation.warn.yourself', [], ctx))
elif Bot.user==member:
await ctx.send(txt('moderation.warn.me', [], ctx))
else:
cursor.execute(f"UPDATE guild_users_{ctx.guild.id} SET warns = {warns+1} WHERE id = {member.id}")
conn.commit()
cursor.execute(f"SELECT warn_ban FROM guilds_settings WHERE id = {ctx.guild.id}")
if warns + 1 >= cursor.fetchone()[0]:
await member.ban(reason=txt('moderation.warn.ban', [], ctx))
await ctx.send(txt('moderation.warn.ban.result', [str(member), str(ctx.author), reason, warns+1], ctx))
cursor.execute(f"SELECT warn_kick FROM guilds_settings WHERE id = {ctx.guild.id}")
elif warns + 1 >= cursor.fetchone()[0]:
await member.kick(reason=txt('moderation.warn.kick', [], ctx))
await ctx.send(txt('moderation.warn.kick.result', [str(member), str(ctx.author), reason, warns+1], ctx))
else:
await ctx.send(txt('moderation.warn.result', [str(member), str(ctx.author), reason, warns+1], ctx))