从Node.js添加Alexa技能会话属性

时间:2018-07-19 04:44:34

标签: node.js alexa alexa-skills-kit alexa-skill

在Node.js代码中使用Alexa技能中的会话属性

code

但是输出不确定。未定义应该是一种时尚。

undefined should be fashion

请参考图片获取代码

GET /repos/:owner/:repo/pulls/:number/reviews

2 个答案:

答案 0 :(得分:2)

尝试一下

要向会话添加属性,

Object.assign(this.attributes, {
    "lastSpeech" = this.event.request.intent.slots.category.value;
});

要从会话中检索它,

var a = this.attributes.lastSpeech;

希望这对您有所帮助。最好的:)

答案 1 :(得分:0)

idx <- match(c("A", "B", "C", "D", "E"), V(graph 1)$name)# selected nodes in graph 1 

g <-E(graph 1) [ from(idx) ] # edge sequence of selected nodes in graph 1

idx_indirect <-match(c("A", "B", "C", "D". "E"), V(graph 2)$name)# selected nodes in graph 2

g2 <- E(graph 2) [ from(idx_indirect) ] # edge sequence of selected nodes in graph 2

g_subgraph <- subgraph.edges(graph 1, g)# create sub graph for edge sequence in graph 1
g2_subgraph <- subgraph.edges(graph 2, g2)# create sub graph for edge sequence in graph 2

graph= graph.union(g_subgraph,g2_subgraph, byname = T) # merge both sub graphs