Tag: botframework

我正在尝试使用Microsoft bot框架来构build聊天机器人

我在这里定义了一本字典 var dict = {'English 101?': 'Room 205', 'English 102?': 'Room 309', 'Math 301': 'Room 705', 'Math 302': 'Room 704'}; 当用户询问“英语101在哪里”时,我想让机器人在“205室”回复。 我用下面的方式对它进行硬编码: var builder = require('botbuilder'); var helloBot = new builder.TextBot(); var dialog = new builder.CommandDialog(); dialog.matches('^Where is English 101?', builder.DialogAction.send('In Room 205')); dialog.matches('^Where is English 102?', builder.DialogAction.send('In Room 309')); dialog.matches('^Where is Math 301?', builder.DialogAction.send('In […]

我怎样才能把我写在NodeJS中的MS文本机器人程序集成到Skype的机器人?

我想开发一个Skype用户名称作为input,并根据用户input在相反的字符大小写hello username 。 简而言之,如果用户input他的名字作为james ,我的机器人会回应他, Hello JAMES 。 该程序运行良好,但是我发现它不明确将我的textbot程序集成到Skype的机器人。 这是我的代码: var builder = require('botbuilder'); var helloBot = new builder.TextBot(); helloBot.add('/', [ function (session, args, next) { if (!session.userData.name) { session.beginDialog('/profile'); } else { next(); } }, function (session, results) { session.send('Hello %s!', session.userData.name); } ]); helloBot.add('/profile', [ function (session) { builder.Prompts.text(session, 'Hi! What is your […]

基于微软Bot框架的机器人可以连接到多个渠道?

所以我现在已经检查了多个示例,但是我还没有看到连接到Facebook和Skype的聊天机器人,而不仅仅是其中之一,如果您的机器人可以连接到多个渠道,是否有一个在代码中的方式来区分消息来自哪个频道?

导出节点JS中的类

我写了三个函数如下。 我已经在一个包中放入了amp.js和dish.js。 amp.js: var amp = (function() { //return ("This is a message from the demo package"); function amp(){ this.id=10; } amp.prototype.display=function(){ return 'value of id is'; } }()); exports.amp =amp; dish.js: var cc=require('./amp'); exports.amp=cc.amp; EX.js: var builder = require('botbuilder'); var just=require('JUST'); console.log(just); var amp= new just.amp(); console.log(amp); //var ww=new builder.ConsoleConnector(); // Create bot and […]

Microsoft Bot框架错误 – InternalServerError {“消息”:“发生错误。”}

当我把bot代码推到azure色的时候,它是成功的。 在使用节点app.js将其推到azure色之前,我testing了它的工作 我用正确的凭据更新了我的web.config文件 var builder = require('botbuilder'); var connector = new builder.ConsoleConnector().listen(); var bot = new builder.UniversalBot(connector); bot.dialog('/', [ function (session) { builder.Prompts.text(session, 'Hi! What is your name?'); }, function (session, results) { session.send('Hello %s!', results.response); } ]); 当我看着azure色的日志,我收到以下消息 2016-11-17T13:31:12.880 Executing: 'Functions.messages' – Reason: 'This function was programmatically called via the host APIs.' 2016-11-17T13:31:12.880 Function […]

微软bot框架消息编辑事件

在微软的bot框架中,使用node.js sdk,是否有可能收听消息编辑事件? 例如,在闲置的用户可以编辑他们以前发送的消息,有没有办法从机器人端听编辑事件? 谢谢

发送直接消息给用户

现在,我的机器人听一个叫做“小组”的闲暇频道,并在那个频道上回复。 我希望它通过直接消息来回复用户(比如'User1')。 我怎样才能构build一个消息来做到这一点? 谢谢!

botchatwork在网聊中提到会话ID

我们如何在botframework webchat聊天中提到对话id ,而不是随机生成? 我们现在可以提及网webchat的userid username和username ,但是不能提供对话id 。

Microsoft Bot Framework请求中的MissingProperty错误

我正在使用Microsoft Bot Framework的应用程序。 我的应用程序是用Node编写的。 在这个时候,我正在尝试使用下面的代码发布一个活动: var https = require('https'); var token = '[receivedToken]'; var conversationId = '[conversationId]'; var options = { host: 'directline.botframework.com', port: 443, headers: { 'Authorization': 'Bearer ' + token' }, path: '/v3/directline/conversations/' + conversationId + '/activities', method: 'POST' }; var request = https.request(options, (res) => { console.log(res.statusCode); var body = []; res.on('data', […]

检测Bot框架中的表情符号

我正在开发Bot框架。 当收到消息时,我需要检测传入消息中发送的表情符号。 我正在考虑使用正则expression式来做到这一点,但我不能。 问题是不同的渠道发送不同的表情符号到机器人。 我已经注册了一个“接收”事件的听众,并看看为不同的频道提供的文本发送相同的笑脸表情符号: 松弛:smile: Skype: <ss type="smile">:)<ss> 模拟器: 😀 我需要确定我正在接受哪种表情符号,并采取行动。 无论我使用的是什么频道,理想情况下我都会收到表情符的Unicode字符。 有没有办法做到这一点?