A
A
aassww2020-01-02 18:28:03
In contact with
aassww, 2020-01-02 18:28:03

How to make a keyboard sent to another user inline?

I have a bot that sends a keyboard with a message to another user. How to make it inline? Tried everything, gives an error. Here is the code:

await vk.api.messages.send({
      user_id: id,
      message: `text`,
      keyboard:
      keyboard = Keyboard.keyboard()
  })
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Trofimov, 2020-01-02
@thewayofmagic

I take it you are using the "vk-io" module?
I didn't change much of your code:

const { VK, Keyboard } = require('vk-io');
await vk.api.messages.send({
      user_id: id,
      message: `text`,
      keyboard: Keyboard.builder()
      .textButton({ label: "Текст", payload: {}, color: Keyboard.SECONDARY_COLOR
      .inline(true)
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question