Veo el ejemplo sobre cómo hacer que el bot de PVA inicie la conversación, pero necesito una forma de que el bot de PVA inicie el saludo cuando alguien abre la ventana de chat del bot. Hasta ahora, he intentado modificar el código para que el saludo de inicio se active de esta manera, pero sigo recibiendo un error de conexión que parece indicar que el hecho de que estamos haciendo todo a través de 365 está causando un problema. Estamos utilizando el administrador del portal en Dynamics 365 para ejecutar y crear nuestro sitio web y las secciones de PVA y PVA está en este mismo entorno en línea, la plantilla web se ve así:
<!-- Power virtual agents web template V2.0--> {% assign botconsumer = entities.adx_botconsumer[bot_consumer_id] %} {% assign env = environment %} {% assign languageCode = website.selected_language.code %} {% assign botConfig = botconsumer.adx_configjson %} <div class="pva-floating-style"> <div name="webChat"></div> <script type="text/javascript" id="pvaChatInlineScript"> var script = document.createElement('script'); script.onload = function() { var botConfig = {{botConfig}}; // Learn more about advanced configuration: https://go.microsoft.com/fwlink/?linkid=2147420 const webChatHeaderStyleOptions = botConfig?.webChatHeaderStyleOptions; const webChatCanvasStyleOptions = botConfig?.webChatCanvasStyleOptions; const webChatWidgetStyleOptions = botConfig?.webChatWidgetStyleOptions; const botTitle = botConfig?.headerText; let chatWidth = "320px"; let chatHeight = "480px"; window.PvaEmbeddedWebChat.renderWebChat( { "container": document.getElementsByName('webChat')[0], "botSchemaName": "{{ botconsumer.adx_botschemaname }}", "environmentId": "{{ env.Id }}", "width": chatWidth, "height": chatHeight, "client": "msportals", // client and version is needed for the ease of future breaking changes "version": "v1", "headerText": botTitle, "webChatCanvasStyleOptions": webChatCanvasStyleOptions, "webChatHeaderStyleOptions": webChatHeaderStyleOptions, "webChatWidgetStyleOptions": webChatWidgetStyleOptions, "accessibilityLanguage": "{{languageCode}}", "suggestedActionLayout": "stacked" }); } script.src = "https://embed.powerva.microsoft.com/webchat/embedded.js?client=msportals&version=v1"; document.getElementsByTagName('head')[0].appendChild(script); </script>Muchas gracias y espero que alguien aquí tenga una idea de cómo se puede hacer esto, he estado jugando a esto durante más de una semana y estoy empezando a sentirme derrotado.