H
H
Help_please2020-07-04 10:08:05
Python
Help_please, 2020-07-04 10:08:05

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

1 answer(s)
S
soremix, 2020-07-04
@Help_please

def sqlite3_simple_example_create_db(message):

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question