G
G
gadzhi152016-04-10 22:20:48
Python
gadzhi15, 2016-04-10 22:20:48

Authorization in the Telegram bot. What is the best way to organize?

There is a script written in python that analyzes a certain file and sends a message to the user in Telegram through a bot. So far, I've only tested it with a strict indication of chat_id. Since more than one person will use the bot, it became necessary to identify the user. For example, the user will be identified by id = 4040. I.e. the user adds a bot and sends an id to it. If the id matches what is specified in the script (well, or in an external database), then the user connects, and the results of the script execution from that moment should be sent to him.
What is the best way to organize all this and where to start in general? I am using Python 2.7 and the library https://github.com/python-telegram-bot/python-tele... .
And how in the script itself to track the successful connection of the user?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2019-04-26
Gavr @GhostGavr

you generate N passphrases, at the start command, the bot asks "say the password and go through" after which if the password matches, save the user ID and mark the password as used

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question