cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2805
Views
0
Helpful
5
Replies

Cisco Jabber Bot - robot-button not shown in 12.6

andrea.lotronto
Level 1
Level 1

When using rich text messages (robot-button) from bot (botkit), those appears in Jabber client 12.6 as a normal text, as showing follow:
jabber_12_6.png

 

Instead in Jabber client 12.1, this kind of message appears correctly, as showing follow:jabber_12_1.png

 

The message is sent in the following form:

 

<message to='*******' id='dKR5h-52' xml:lang='it' type='chat'>
        <thread>23096</thread>
        <html xmlns='http://jabber.org/protocol/xhtml-im'>
            <body xmlns='http://www.w3.org/1999/xhtml' xml:lang='it'>
                <p style='font-weight:normal'></p>
                <form onsubmit='return false;'>
                    <button robot-type='robot-button' type='button' robot-message='Autorizzazione transazione SAP'>Autorizzazione transazione SAP</button>
                    <button robot-type='robot-button' type='button' robot-message='Richiesta nuovo dispositivo'>Richiesta nuovo dispositivo</button>
                    <button robot-type='robot-button' type='button' robot-message='Reset password SAP'>Reset password SAP</button>
                    <button robot-type='robot-button' type='button' robot-message='Guide strumenti Ferrero'>Guide strumenti Ferrero</button>
                    <button robot-type='robot-button' type='button' robot-message='Controllo validità dispositivo'>Controllo validità dispositivo</button>
                    <button robot-type='robot-button' type='button' robot-message='Problema transazione SAP'>Problema transazione SAP</button>
                </form>
            </body>
        </html>
    </message

Looking for a solution, we have found this issue in the github botkit repository :

 

https://github.com/howdyai/botkit/issues/1581

then as recommended, we added in the jabber client configuration the <WhitelistBot> tag with the JID of the used BOT, but the problem persists.

 

Any suggestions?

 

5 Replies 5

andrea.lotronto
Level 1
Level 1

I found this discussion

 

https://community.cisco.com/t5/audio-and-video-endpoints/cisco-jabber-bot-rich-text-css-bootstrap-doesn-t-work-with/td-p/3796694

 

but, both updating the Jabber client to "12.7.0.38632" version,  and adding in the configuration the AdminConfiguredBot tag the problem persists.

 

Any suggestions?

After configuring the <AdminConfiguredBot> setting, you should see a _BotGroup group in the Jabber client listing your bot name (this can take some time to populate to the client.) Can you confirm you are seeing that? If so, this learning lab takes you step-by-step through testing a sample Jabber bot, including HTML message content: https://developer.cisco.com/learning/lab/jabber-botkit-lab/step/1
If all that fails, then we may need to do some troubleshooting...

Yes I confirm that is see _BotGroup. Moreover the used xml message is compliant with the documentation in https://developer.cisco.com/learning/lab/jabber-botkit-lab/step/4.

In detail I rewrite the used message:

<message to='*******' id='dKR5h-52' xml:lang='it' type='chat'>
        <thread>23096</thread>
        <html xmlns='http://jabber.org/protocol/xhtml-im'>
            <body xmlns='http://www.w3.org/1999/xhtml' xml:lang='it'>
                <p style='font-weight:normal'></p>
                <form onsubmit='return false;'>
                    <button robot-type='robot-button' type='button' robot-message='Autorizzazione transazione SAP'>Autorizzazione transazione SAP</button>
                    <button robot-type='robot-button' type='button' robot-message='Richiesta nuovo dispositivo'>Richiesta nuovo dispositivo</button>
                    <button robot-type='robot-button' type='button' robot-message='Reset password SAP'>Reset password SAP</button>
                    <button robot-type='robot-button' type='button' robot-message='Guide strumenti Ferrero'>Guide strumenti Ferrero</button>
                    <button robot-type='robot-button' type='button' robot-message='Controllo validità dispositivo'>Controllo validità dispositivo</button>
                    <button robot-type='robot-button' type='button' robot-message='Problema transazione SAP'>Problema transazione SAP</button>
                </form>
            </body>
        </html>
    </message>

 

I'm not sure precisely what your HTML code is trying to do, and the stanza parts have some extra attributes (like xml:lang).  Here is a controller.hears() I got working using the Botkit 'legacy' branch example jabber_bot.js:

 

controller.hears(['test'], ['direct_mention', 'self_message', 'direct_message'], function (bot, message) {
    let reply_message = {};
    let to = message.user;
    let type = message.group ? 'groupchat' : 'chat';

    let body = 'test';
    reply_message.text = body;
    reply_message.stanza = 
        xml`<message to="${to}" type="${type}"><body>${body}</body><html xmlns="http://jabber.org/protocol/xhtml-im"><body xmlns="http://www.w3.org/1999/xhtml"><div class="container"><h6>${body}</h6>
            <button robot-type='robot-button' type='button' robot-message='Autorizzazione transazione SAP'>Autorizzazione transazione SAP</button>
            <button robot-type='robot-button' type='button' robot-message='Richiesta nuovo dispositivo'>Richiesta nuovo dispositivo</button>
            <button robot-type='robot-button' type='button' robot-message='Reset password SAP'>Reset password SAP</button>
            <button robot-type='robot-button' type='button' robot-message='Guide strumenti Ferrero'>Guide strumenti Ferrero</button>
            <button robot-type='robot-button' type='button' robot-message='Controllo validità dispositivo'>Controllo validità dispositivo</button>
            <button robot-type='robot-button' type='button' robot-message='Problema transazione SAP'>Problema transazione SAP</button>
        </div></body></html></message>`;
    bot.reply(message, reply_message);
});

Here is the interaction in Jabber Windows 12.6.1.34405:

Screenshot-20191112141931-445x422.png

Hi David, The sample code you showed is not working for Jabber version 12.9.1.53980. Buttons appear as regular text. Any idea what could be causing this? Thank you in advance.

 

jbbrbot.PNG