Answer the question
In order to leave comments, you need to log in
How to make Telegram bot work separately for each JAVA user?
The bot accepts some values from users and sends them a response after processing. But it happens that if two users use it at the same time, then their entered data is mixed and the bot does not work correctly.
Tried like this:
public void onUpdateReceived(Update update) {
new Thread(new Runnable() {
@Override
public void run() {
}).start();
}
Answer the question
In order to leave comments, you need to log in
From update get chatId and set in sendMessage.
Read the documentation - there answers to all questions. Or articles, for example:
https://habr.com/en/post/476306/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question