Answer the question
In order to leave comments, you need to log in
Telegram bot error on pyTelegramBotApi. How to fix?
Code:
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)
Error:
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
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question