Hola, estamos desarrollando chatbots utilizando bot framework e integrándolos con múltiples canales como WhatsApp, mensajes comerciales de Google, Facebook, web, línea, etc. Estábamos usando diálogos en cascada antes y ahora estamos pasando a diálogos adaptables. ¿Puede alguien ayudarme a definir la lista, los botones, todo lo que WhatsApp u otros canales admiten en el archivo lg de diálogo adaptable? En las muestras de documentación, solo se mostraban las tarjetas predeterminadas. Estamos usando node js para desarrollo y botframework V4.
Nota : si está creando un bot en Node.js , entonces necesita usar tarjetas adaptables
Importar el módulo
// Import the module: import * as AdaptiveCards from "adaptivecards"; // OR require it: var AdaptiveCards = require("adaptivecards"); // OR if you loaded via CDN, the global "AdaptiveCards" variable // is already defined and can be used directlyrenderizar una carta
// Author a card // In practice you'll probably get this from a service // see http://adaptivecards.io/samples/ for inspiration var card = { "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "Image", "url": "https://adaptivecards.io/content/adaptive-card-50.png" }, { "type": "TextBlock", "text": "Hello **Adaptive Cards!**" } ], "actions": [ { "type": "Action.OpenUrl", "title": "Learn more", "url": "https://adaptivecards.io" }, { "type": "Action.OpenUrl", "title": "GitHub", "url": "https://github.com/Microsoft/AdaptiveCards" } ] }; // Create an AdaptiveCard instance var adaptiveCard = new AdaptiveCards.AdaptiveCard(); // Set its hostConfig property unless you want to use the default Host Config // Host Config defines the style and behavior of a card adaptiveCard.hostConfig = new AdaptiveCards.HostConfig({ fontFamily: "Segoe UI, Helvetica Neue, sans-serif" // More host config options }); // Set the adaptive card's event handlers. onExecuteAction is invoked // whenever an action is clicked in the card adaptiveCard.onExecuteAction = function(action) { alert("Ow!"); } // Parse the card payload adaptiveCard.parse(card); // Render the card to an HTML element: var renderedCard = adaptiveCard.render(); // And finally insert it somewhere in your page: document.body.appendChild(renderedCard);Puede consultar Uso de tarjetas adaptables con Microsoft Bot Framework , Presentación de Bot Framework Adaptive Dialogue y Diálogos adaptables con muestras de habilidades de Bot Framework