11-07-2019 02:38 AM
When using rich text messages (robot-button) from bot (botkit), those appears in Jabber client 12.6 as a normal text, as showing follow:
Instead in Jabber client 12.1, this kind of message appears correctly, as showing follow:
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?
11-08-2019 02:16 AM - edited 11-08-2019 03:08 AM
I found this discussion
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?
11-08-2019 09:03 AM
<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/111-09-2019 06:50 AM - edited 11-09-2019 06:51 AM
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>
11-12-2019 12:21 PM
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:
10-19-2020 08:01 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide