N
N
Nodir Malikov2021-03-08 20:46:37
Java
Nodir Malikov, 2021-03-08 20:46:37

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();
    }

But all the same.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2021-03-08
@xez

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 question

Ask a Question

731 491 924 answers to any question