Search code examples
javascripthtmlbotframeworkmicrosoft-teamsadaptive-cards

Is it possible to render a javascript script within MSBOT card?


We are trying to integrate our BOT solution with a third party application that is monitored by agents. We have got the javascript digest that when clicked renders an HTML page with connection to the escalation tool.

I have looked into Tompaana's Intermediate BOT sample already and kind of know what we must do for 3rd party integration. I am looking for a simpler way if possible.

<!-- BoldChat Live Chat Button HTML v5.00 (Type=HTML,ChatWindow=IT Service Desk Window,Department=- None -,Website=IT Service Desk Support) -->
<div style="text-align: center; white-space: nowrap;">
<script type="text/javascript">
  var bccbId = Math.random(); document.write(unescape('%3Cdiv id=' + bccbId + '%3E%3C/div%3E'));
  window._bcvma = window._bcvma || [];
  _bcvma.push(["setAccountID", "4000000005912680172"]);
  _bcvma.push(["setParameter", "WebsiteID", "4300003000081610838"]);
  _bcvma.push(["addText", {type: "chat", window: "4380000000014948871", available: "", unavailable: "", id: bccbId}]);
  var bcLoad = function(){
    if(window.bcLoaded) return; window.bcLoaded = true;
    var vms = document.createElement("script"); vms.type = "text/javascript"; vms.async = true;
    vms.src = ('https:'==document.location.protocol?'https://':'http://') + "vmss.boldchat.com/aid/44034000000680172/bc.vms4/vms.js";
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(vms, s);
  };
  if(window.pageViewer && pageViewer.load) pageViewer.load();
  else if(document.readyState=="complete") bcLoad();
  else if(window.addEventListener) window.addEventListener('load', bcLoad, false);
  else window.attachEvent('onload', bcLoad);
</script>
 <span style="font-family: Arial; font-size: 8pt; color: black;"><a href="http://www.boldchat.com" style="text-decoration: none; color: black;">Chat software</a> by BoldChat</span>
</div>
<!-- /BoldChat Live Chat Button HTML v5.00 -->

I would like to know

a) For quick showcase :- If we use MSTeams as a channel, is it possible to render this page on MSTeams, when the BOT escalates in MS Teams?

b) Has anyone integrated BOLDChat with MSBOT?


Solution

  • a) In Microsoft Teams, you can render HTML/JavaScript using task modules which are a sort of modal dialog experience.

    b) I certainly don't know if anyone has integrated BoldChat/Bold360 with the Microsoft Bot Framework, but if you have specific issues that you're running into while trying to do that then please post a new very specific question.