How to make Telegram bot inline keyboard private? Node.JS

// command for starting request with a simple anti-spam shiet
bot.command('movie', (ctx) => {   
        let stopSpam = findUserData(ctx);
        if (stopSpam) {
        } else {
            userData.push({id:, msgId: ctx.message.message_id});

// So the issue is right here. 
//Right now I'm checking if the user has already used the comand 'movie'. 
//If so, he could use its buttons. But he could use the buttons from another user too...
bot.action(/.+/,(ctx) => {
    let allowed = findUserCallbackData(ctx);
    if (allowed) {
        ctx.editMessageReplyMarkup((m) => m.inlineKeyboard([]));
        allowed.queryGenre =;
        ctx.reply('Época', timeMenu)
            .then(() => {
            .catch(e => {
    }   else {

findUserData = (ctx) => {
    let findCmdUser = userData.find(user => ===
    return findCmdUser

findUserCallbackData = (ctx) => {
    let findUser = userData.find(user => ===
    return findUser

I'm in a cinema telegram group and I'm making a bot for movies recomendations using inline keyboard as data giver.

The issue is inline keyboard is not only visible but interactive for every single group member.

So my question is, can I prevent this from happening somehow? Can I make the inline keyboard only accesible (and visible, if possible) for the user which inserts the proper command?

Sorry for my basic English and thank's for your time.



Inline keyboard is attached directly to message so it's not possible to make it visible for some participants only.


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.