我有一个使用微软botframework的聊天机器人,我的webapp在Azure上运行聊天机器人。如何将图片作为对消息的回复。我们有使用Skype,Messenger和KiK的客户
发布于 2016-06-30 15:20:00
请看一下image and file attachments上的文档部分
replyMessage.Attachments.Add(new Attachment()
{
ContentUrl = "https://upload.wikimedia.org/wikipedia/en/a/a6/Bender_Rodriguez.png",
ContentType = "image/png"
});
或者作为JSON:
{
"attachments": [
{
"contentType": "image/png",
"contentUrl": "https://upload.wikimedia.org/wikipedia/en/a/a6/Bender_Rodriguez.png"
}
]
}
您还可以发送Rich Card:
replyMessage.Attachments = new List<Attachment>();
replyMessage.Attachments.Add(new Attachment()
{
Title = "Bender",
TitleLink = "https://en.wikipedia.org/wiki/Bender_(Futurama)",
ThumbnailUrl = "http://www.theoldrobots.com/images62/Bender-18.JPG",
Text = "Bender Bending Rodríguez, commonly known as Bender, is a main character in the animated television series Futurama.",
FallbackText = "Bender: http://www.theoldrobots.com/images62/Bender-18.JPG"
});
https://stackoverflow.com/questions/38123795
复制相似问题