D
D
dedmaksim0072021-03-14 12:23:49
Bots
dedmaksim007, 2021-03-14 12:23:49

How to make it so that each user has a separate thread?

Hello everyone!
I had a problem writing a telegram bot. In short, I am writing a telegram bot for the game "Cities".
If the bot is used by one person, then everything is fine, but as soon as more than one person uses it, then a problem arises, for example, there are two people: Petya and Vasya. Petya needs to write the city with the letter A, and Vasya at that moment calls the city Krasnodar, and then Petya already needs to write the city with the letter R, although before Vasya's answer it was necessary for A.
Here somehow you need to connect the databases, or somehow interact with threads?
I'm writing a bot on aiogram

PS I'm a newbie in this field, so please don't throw stones!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex K, 2021-03-14
@alexk111

If you only need to store a letter that is common to all participants, just store it in a variable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question