Answer the question
In order to leave comments, you need to log in
How to add telegram user id to sqlite database?
How to make it so that when you click /start, the person's id is automatically entered into the sqlite database?
Answer the question
In order to leave comments, you need to log in
connection = sqlite3.connect("PATH")
cursor = connection.cursor()
cursor.execute("INSERT OR IGNORE INTO users (id) VALUES (:id)", {"id": id})
OR IGNORE
so that if the user is already registered, nothing happens (otherwise there will be an error) Nikita Shoshin , by the way, have you come across such an error by chance?
sqlite3.InterfaceError: Error binding parameter :id - probably unsupported type.
SQLite for simple needs is no different than mysql if you're interested in the syntax.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question