Answer the question
In order to leave comments, you need to log in
Why did the sqlite3: near "Dim": syntax error appear?
I made a bot discord and this error popped up, the bot does not have people with the nickname "Dim",
there are no such variables and there are no other words related to this, I climbed a lot of forums but there I did not find a solution to my problem.
async def on_ready():
cursor.execute("""CREATE TABLE IF NOT EXISTS stats(
name TEXT,
id INT,
warn INT,
rep INT
)""")
connection.commit()
for guild in client.guilds:
for member in guild.members:
if cursor.execute(f"SELECT id FROM stats WHERE id = {member.id}").fetchone() is None:
try:
cursor.execute(f"INSERT INTO stats VALUES ('{member}', {member.id}, 0, 0)") #Кричит на эту строку
connection.commit()
except Exception:
print('Ошибка')
print(sys.exc_info()[1])
else:
pass
Answer the question
In order to leave comments, you need to log in
Comment out the line:
cursor.execute(f"INSERT INTO stats VALUES ('{member}', {member.id}, 0, 0)")
print(f"INSERT INTO stats VALUES ('{member}', {member.id}, 0, 0)")
cursor.execute("INSERT INTO stats VALUES (?,?,?,?)",(member,member.id,0,0))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question