在Microsoft Azure Chatbot中发送图像附件 [英] Send an image attachment in Microsoft Azure Chatbot

查看:53
本文介绍了在Microsoft Azure Chatbot中发送图像附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Microsoft Azure机器人服务和LUIS创建了一个聊天机器人.使用在LUIS上受过训练的机器人,我可以接收短信.我已将漫游器连接到Skype频道.

I have a created a Chat bot using Microsoft Azure bot service and LUIS. With my bot which was trained on LUIS, I'm able to receive text messages. I have connected the bot to Skype channel.

我不知道如何返回图像附件作为对消息的答复.

I don't know how to return a image attachment as an answer to a message.

我听说有些Microsoft机器人框架可以将图像作为附件发送,我不确定Azure机器人服务.

I heard some of the Microsoft bot framework can send image as an attachment and I'm not sure about Azure bot service.

示例代码:

var recognizer = new builder.LuisRecognizer(LuisModelUrl);

var intents = new builder.IntentDialog({ recognizers: [recognizer] })
    .matches('**Greetings**', (session, args) => {session.send('**Hi! Welcome**');});

bot.dialog('/', intents); 

我的案子:

我想在下面的URL图片上附加嗨!与我的意图"问候"相匹配的欢迎消息.

I want to attach the below URL image with 'Hi! Welcome' message when it matches with my Intent 'Greetings'.

ContentURL:" https: //img.clipartfest.com/13e01fd74f423c39c4af7dcc8a7b8455_animated-welcome-sign-animated-welcome-clip-art-images_1300-899.jpeg ",

ContentURL:"https://img.clipartfest.com/13e01fd74f423c39c4af7dcc8a7b8455_animated-welcome-sign-animated-welcome-clip-art-images_1300-899.jpeg",

ContentType ="image/jpeg"

ContentType = "image/jpeg"

我不知道&以及在我的代码中添加上述内容URL的位置,以将附件发送给邮件.

I don't know how & and where to add the above content URL in my code to send attachment to the message.

有人可以帮我吗?

推荐答案

感谢RAS和mgbennet.

Thanks RAS and mgbennet.

它适用于以下代码:

.matches('Greetings', (session, args) => {
            var reply = new builder.Message(); 
            reply.setText(session, "![Greetings](http://aka.ms/Fo983c)");
            session.send(reply);
  })

这篇关于在Microsoft Azure Chatbot中发送图像附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆