我可以通过使用Twilio将英雄卡发送到Whats应用程序
我有聊天机器人,使用bot框架nodejs sdk构建它,我将此聊天机集成到whatsapp,我想在whatsapp聊天中显示一些按钮,
所以是否有人找到了解决这个问题的解决方案,请帮助我
注意:我尝试发送英雄卡,但我跑到问题
Error: TwilioWhatsAppAdapter.parseActivity():
An activity text or attachment with contentUrl must be specified.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道Bot Framework如何尝试使用按钮发送WhatsApp消息,但我怀疑这符合Twilio想要发送的方式。
当前,要使用按钮发送消息,您需要注册并使用模板消息。当您发送与模板之一匹配的消息的文本时,Twilio也将使用按钮传递整个模板。
对于将来,请注意 twilio noreferrer“> twilio content api api 将简化跨平台的模板,按钮和其他丰富消息。
I don't know how bot framework attempts to send WhatsApp messages with buttons, but I doubt it fits with the way Twilio wants to send them.
Currently, to send a message with buttons, you need to register and use a template message. When you send the text of a message that matches one of your templates, then Twilio will deliver the entire template with buttons as well.
For the future, look out for the Twilio Content API which will streamline templates, buttons and other rich messages across platforms.
看起来您正在使用来自Botbuilder-Community-JS Repo。
查看适配器的代码,它似乎没有配置为处理“签名”卡以外的任何卡(请参阅在这里)。如果您不介意为此做一些小腿工作,我不明白为什么您不能分配此存储库,并以支持类似标志实现的英雄卡的功能来构建。
我想这看起来像这样:
以上可能需要一些按摩,但离这个还不远。然后,您只需要构建库以供使用。
It looks like you are using the TwilioWhatsAppAdapter from the botbuilder-community-js repo.
Looking at the adapter's code, it doesn't appear to be configured to handle any card other than a 'signin' card (see here). If you don't mind doing a little leg work on this, I don't see why you couldn't fork this repo and build in functionality that supports a hero card similar to the signin implementation.
I imagine it would look something like this:
The above may need a little massaging but it wouldn't be far off from this. Then, you just need to build the library for use.