Kik bot static keyboard does not appear

177 Views Asked by At

I was experimenting with a kik bot using Node.js, while I was trying to get a static keyboard to appear when user sends a 'help' message, it only sent the two replies and the static keyboard does not pop up. According to me it should work.

This is the function that sends the help messages:

/**
 * 
 * @param {Message} message
 * 
 * 
 */
function help(message) {

    message.reply('Hello!');
    message.reply('Choose from the options to get an idea of what I can do! ;)');

    message.addResponseKeyboard(['Rate me', 'Set reminder', 'Info']);

}

This is the bot configuration:

let bot = new Bot({
    username: 'purppbot',
    apiKey: 'dba843db-18bb-45fe-b6d6-3a678f420be2',
    baseUrl: 'https://purppbot1-xbeastmode.c9users.io/',
    staticKeyboard: new Bot.ResponseKeyboard(['Help', 'Info'])
});
1

There are 1 best solutions below

0
On

I honestly don't know about Node.js; but as far as I see, I think you are expecting Static Keyboard to do what a Suggested Response Keyboard would do.

Regarding Static Keyboard, according to the API Reference of Kik docs, The static keyboard allows you to define a keyboard object that will be displayed when a user starts to mention your bot in a conversation, whilst regarding Suggested Response Keyboard, A suggested response keyboard presents a set of predefined options for the user.

It means the static keyboard is shown when a user starts to mention your bot in a conversation; and it disappears once a message is sent to the bot. And when the bot sends back a message to the user, it will contain its message(s) and Suggested Response Keyboard sent by the bot along with the message. In case no Suggested Response Keyboard is sent by the bot along with the message(s), the static keyboard is not shown until the user again starts to mention the bot's username.

So, in your case, you might want to send the those responses through Suggestive Responses Keyboard, which your bot would need to send along with the text message, every time a user sends the 'help' message.

I hope this helps.