Ошибка у телеграмм боте на pyTelegramBotApi. Как исправить?
Код:
import telebot
import sqlite3
bot = telebot.TeleBot('token')
@bot.message_handler(commands=['start'])
def sqlite3_simple_example_create_db():
id_user = message.from_user.id
con = sqlite3.connect('db.db')
cur = con.cursor()
cur.execute('INSERT INTO subscriptions VALUES (id_user")')
con.commit()
cur.close()
con.close()
bot.polling(none_stop=True)
Ошибка:
TypeError: sqlite3_simple_example_create_db() takes 0 positional arguments but 1 was given
"
Traceback (most recent call last):
File "bot.py", line 117, in
bot.polling(none_stop=True)
TypeError: sqlite3_simple_example_create_db() takes 0 positional arguments but 1 was given
File "bot.py", line 13, in sqlite3_simple_example_create_db
cur.execute('INSERT INTO subscriptions VALUES (id_user")')
sqlite3.OperationalError: unrecognized token: "")"
"
Traceback (most recent call last):
File "bot.py", line 117, in
bot.polling(none_stop=True)
File "bot.py", line 13, in sqlite3_simple_example_create_db
cur.execute('INSERT INTO subscriptions VALUES (id_user")')
sqlite3.OperationalError: unrecognized token: "")"