R
R
Roki99992020-05-06 23:30:15
SQLite
Roki9999, 2020-05-06 23:30:15

How to store user ids in sqlite + Pytelrgrambotapi database?

How to save user ids to a database in Python3 through a bot. Preferably use sqlite.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey_Dolg, 2020-05-07
@Andrey_Dolg

Minimum:
Make a database, table users( column : id primary key, column : user_id text ) or every time you start the bot, execute an sql query to create such a table called the create table if not exist construct .
When connecting to a sqlite database, if it doesn't exist, Python will create it.
In the service that will listen to the bot, create a connection object to the sqlite database and call a request to add a user.
If you can’t google a similar example, then learn the basics of working with sqlite from python, everything is done quite primitively there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question