Para bots de apoio e de chat de equipa
Respostas enriquecidas em chats que não executam scripts
Os chats de equipa e os widgets de apoio ao cliente muitas vezes só mostram texto e imagens. Peça à WebKnox uma imagem do cartão e publique-a ao lado da resposta em 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°.
Só texto, ou texto com o cartão
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.
Onde encaixa num bot
O seu bot já recebe a mensagem. Uma chamada devolve o texto e uma ligação para a imagem.
- Alguém perguntanum canal ou num chat de apoio
- O seu botpede também uma imagem à WebKnox
- matched: truepublique o texto com a imagem em anexo
- matched: falseo seu bot responde como de costume
// 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 ter em conta nos bots
As ligações das imagens expiram
Uma ligação de imagem funciona até render.expires_at. Carregue a imagem na plataforma se uma mensagem tiver de a manter durante mais tempo.
O texto continua a ser a resposta
Publique sempre também o text: é pesquisável e os leitores de ecrã leem-no.
Nos planos Pro e Scale
As imagens alojadas estão incluídas nos planos Pro e Scale e custam um token extra cada uma.