【发布时间】:2017-08-10 20:38:37
【问题描述】:
我想将topic_to_learn 变量传递给第二个函数,并在第二个函数中用于其他用途。
function (session, args, next) {
var topic_to_learn = builder.EntityRecognizer.findEntity(args.entities, 'topic_to_learn');
builder.Prompts.text(session, 'Sure, can you please also tell me about your goals or anything you want to achieve after learning about this topic?');
},
function (session, results, next) {
var learning_goals = results.response;
session.send('Got it, let me think...', session.message.text);
session.send('Voila! These are the articles related to ' + topic_to_learn, session.message.text);
},
【问题讨论】:
-
请提供完整代码或至少一个minimal reproducible example。这两个中间有逗号的函数表达式单独存在时是语法错误。他们在互相打电话吗?完全不清楚它们是如何使用的。
-
非常感谢,您的所有回答都启发了我,我找到了方法,非常感谢!!
标签: javascript node.js bots azure-language-understanding