Para bots de soporte y de chat de equipo
Respuestas enriquecidas en chats que no ejecutan scripts
Los chats de equipo y los widgets de soporte suelen mostrar solo texto e imágenes. Pide a WebKnox una imagen de la tarjeta y publícala junto a la respuesta de texto.
15° and partly cloudy in Dresden right now. Light rain starts around 8 pm and gets heavier after 10 pm.
15° and partly cloudy in Dresden right now. Light rain starts around 8 pm and gets heavier after 10 pm; it eases off by about 7 am, and Thursday stays mostly dry with a high of 12°.
Solo texto, o texto con la tarjeta
A medium banana (118 g) has about 105 kcal, mostly from carbohydrates: 27 g, including 14 g of sugars. It also gives you 3.1 g of fiber and 422 mg of potassium.
Dónde encaja en un bot
Tu bot ya recibe el mensaje. Una sola llamada devuelve el texto y un enlace a la imagen.
- Alguien preguntaen un canal o en un chat de soporte
- Tu botpide a WebKnox también una imagen
- matched: truepublica el texto con la imagen adjunta
- matched: falsetu bot responde como siempre
// Ask for a hosted image along with the answer body: JSON.stringify({ messages, render: { formats: ['image'] } }) if (answer.matched) { // Post the text, with the card as an image await chat.postMessage({ text: answer.text, attachments: [{ image_url: answer.render.image_url }], }); } else { await chat.postMessage({ text: await myBot.reply(messages) }); }
A tener en cuenta en bots
Los enlaces de imagen caducan
Un enlace de imagen funciona hasta render.expires_at. Sube la imagen a la plataforma si un mensaje debe conservarla más tiempo.
El texto sigue siendo la respuesta
Publica siempre también text: se puede buscar y los lectores de pantalla lo leen.
En Pro y Scale
Las imágenes alojadas vienen con Pro y Scale y cuestan un token adicional cada una.