N
N
Nikolai Neizvestny2020-05-19 12:00:39
Python
Nikolai Neizvestny, 2020-05-19 12:00:39

Python telegram bot is it possible to have a dialogue by id aka chat_id?

Is it possible to have a dialogue so that the bot sends answers by chat_id?
the fact is that I use global variables, when several people use the bot at the same time, all requests sent by one are transmitted in the same way to the other, how can I fix this and if it’s not difficult, maybe there are ways of a different approach
thanks for the help

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Timur Pokrovsky, 2020-05-19
@Makaroshka007

use lists and user classes

E
ediboba, 2020-05-19
@ediboba

when a user writes to the bot, this message has a from_id. On this from_id and send the answer. You don't need to write this from_id in global. Request came to some function -> prepared response -> answered from_id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question