Slasher99
Slasher99

Reputation: 1

How to add buttons to KIK bot to capture user input?

So, I have a KiK bot and want to add buttons to the bottom of the chat window to ask specific questions. The user clicks on one, which is taken as there response and processed as a message. The buttons then change again based on this response. I've seen it in a lot of other KIK apps, but there's nothing in the KiK API that says how to do it! Does anyone know how to create these response buttons in KIK? :)

Upvotes: 0

Views: 521

Answers (2)

dd619
dd619

Reputation: 6170

Adding my solution as it may help to someone:

function sendButtons() {
    var arrResponse = [{ type: "text", body: "Summer" }, { type: "text", body: "Rainy" }, { type: "text", body: "Winter" }];
    var sendingMessage = Bot.Message.text("Which Season do u like the most?")
    bot.send(sendingMessage.addResponseKeyboard(arrResponse), recipient);
}

As you can see, you need to create an array of the input to show the user on keyboard. And then attach this response array to the message.

Upvotes: 0

Robin
Robin

Reputation: 116

What you're looking for are keyboards (specifically the Suggested Response Keyboard), you can read up on how to use them here: https://dev.kik.com/#/docs/messaging#keyboards

Upvotes: 1

Related Questions