R
R
Riky15422021-01-23 21:48:27
In contact with
Riky1542, 2021-01-23 21:48:27

How to make the buttons in the conversation open for the exact person who wrote the command?

In a conversation with 30 people and when you enter the way command, help buttons appear for everyone, how to make the buttons open exactly for the user who entered the command, and not for everyone.

cmd.on(/^(?:way помощь)$/i, async (message) => {
  if(message.chatId == 11) return message.send('В этой беседе эта команда запрещена');
  if (!message.isChat) return 
  let text;
  return message.answer(`привет! Нажимай туда, что хочешь узнать.`, { keyboard: Keyboard.keyboard([
    [
    Keyboard.textButton({
    label: `Форма 1`,
    color: Keyboard.POSITIVE_COLOR,
    payload: {
      command: `Форма 1`,
    }
    })
    ],
    [
      Keyboard.textButton({
    label: `Форма 2`,
    color: Keyboard.NEGATIVE_COLOR,
    payload: {
      command: `Форма 2`,
    }
      })
      ],
      [
        Keyboard.textButton({
      label: `Форма 3`,
      color: Keyboard.NEGATIVE_COLOR,
      payload: {
        command: `Форма 3`,
      }
        })
        ]
    ])
  .oneTime()
    });
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question