Hi. I'm implementing bot behaviour according to user actions. I faced this problem: if multiple users responding to callback_query at the same moment, all of them will receive the result of first user who responded.
Example:
await bot.getUpdates();
if (text === '/top') {
return await printTop(chatId);
}
async function printTop(chatId: string) {
if (!chatId) {
throw new Error(`Error: chatId = ${chatId}`);
}
await bot.sendMessage(chatId, 'some info');
return sendInfo(chatId);
}
At the moment the first user clicks on inline_keyboard option by sendInfo(), all other users who clicked the same inline_keyboard at the same moment of time, but selected different option, will see in they TG bot reply option, selected by the first user.
Why is this happening and how to prevent this?
I need to send to each user inline_keyboard option selected by that user and not by the first user who clicked.
Hi. I'm implementing bot behaviour according to user actions. I faced this problem: if multiple users responding to callback_query at the same moment, all of them will receive the result of first user who responded. Example:
At the moment the first user clicks on inline_keyboard option by sendInfo(), all other users who clicked the same inline_keyboard at the same moment of time, but selected different option, will see in they TG bot reply option, selected by the first user.
Why is this happening and how to prevent this? I need to send to each user inline_keyboard option selected by that user and not by the first user who clicked.