A
A
aab1372021-08-18 17:47:45
Python
aab137, 2021-08-18 17:47:45

Telethon. How can I save the session not to a file, but to a database?

While doing

client = telethon.TelegramClient('anon', api_id, api_hash)

an existing file named anon is created or used.
Let's say I have many accounts and I don't want to have many session files. Is it possible somehow not to save the session not in a separate file, but in a database, for example, sqlite?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilhomidin Bakhoraliev, 2021-08-19
@aab137

Yes, you can use SQLite, MongoDB, and SQLAlchemy.
Here is a link to the documentation:
https://docs.telethon.dev/en/latest/concepts/sessi...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question