如何在图像转发列表显示中使用TouchWrapper组件?

时间:2019-05-01 05:15:25

标签: python alexa alexa-skills-kit alexa-presentation-language

在文档中,内容还不足以准确实现TouchWrapper组件。有人可以帮忙吗?

我已经提到- https://developer.amazon.com/docs/alexa-presentation-language/apl-touchwrapper.html

https://medium.com/@punkpocko/alexa-apl-touch-wrappers-75d62784b3e8

def can_handle(self, handler_input):
    return handler_input.request_envelope.request.type = 'Alexa.Presentation.APL.UserEvent' and handler_input.request_envelope.request.arguments.length>0 and (handler_input.request_envelope.request.arguments[0] == "Desi Flavors" or handler_input.request_envelope.request.arguments[0] == 'Global Flavors')

def handle(self, handler_input):
    if handler_input.request_envelope.request.arguments[0] == "Desi Flavors":
        dish ='Desi Flavors'
    elif handler_input.request_envelope.request.arguments[0] == "Global Flavors":
        dish ='Global Flavors'
    return dish

这是JSON- {     “ type”:“ TouchWrapper”,     “项目”:{         “ type”:“文字”,         “文本”:””,         “颜色”:””,         “字体大小”:””     },     “在线新闻”:{         “ type”:“ SendEvent”,         “参数”:[             “ Desi味道”,             “全球风味”         ]     }

}

我希望输出的结果是,如果人们选择Desi Flavours,它应该存储在变量(盘)中。

0 个答案:

没有答案