@Help_please

Ошибка у телеграмм боте на 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
  • Вопрос задан
  • 157 просмотров
Решения вопроса 1
SoreMix
@SoreMix Куратор тега Python
yellow
def sqlite3_simple_example_create_db(message):
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы